You are given a graph with N nodes and M directed edges. Find C−D.
Where,
C Sum of number of nodes in all Strongly Connected Components with odd number of nodes.
D Sum of number of nodes in all Strongly Connected Components with even number of nodes.
Input:
First line contains 2 integers, N and M, denoting the number of nodes and the number of edges. Next M lines contain 2 integers A and B, meaning that there is a directed edge from A to B.
Output:
Output the number C−D.
Constraints:
1≤N,M≤15
1≤A,B≤N
There are 2 strongly connected components, one has 1 node, and other has 4 nodes.
Therefore, C=1,D=4.