It is audit day at the shale slopes of Greystone. Petr spreads the roads records across the table and picks up a sharp pencil. Task: An undirected graph has n nodes and m edges. Print the number of connected components. Input format: First line: n and m. Next m lines: u v. Output format: Print the component count. Constraints: 1 <= n <= 2113; 0 <= m <= 4226; 1 <= u,v <= n.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 2113; 0 <= m <= 4226; 1 <= u,v <= n.
