# 2011 Зимняя Школа, Харьков, День 8, День Виталия Гольдштейна

# Condensation of the graph

Find the number of edges in the condensation of a given directed graph.

The condensation of a directed graph **G** is a directed graph **G**', whose vertices are strongly connected components of **G**, and the edge in **G**' is present only if there exists at least one edge between the vertices of corresponding connected components.

The graph condensation does not contain multiple edges.

#### Input

The first line contains number of vertices **n** and number of edges **m** (**n** ≤ `10`

, ^{4}**m** ≤ `10`

) in the graph. Each of the next ^{5}**m** lines describe the edge of the graph. The **i**-th edge is given with the starting `b`

and the ending _{i}`e`

(_{i}**1** ≤ `b`

, _{i}`e`

≤ _{i}**n**) vertex of the graph. The input graph can contain the multiple edges and loops.

#### Output

Print the number of edges in graph condensation.

4 4 2 1 3 2 2 3 4 3

2