Caravans arrive at the steppe camp of Horselord Plains with crates of tunnels, and Keeper the accountant must account for every last one. 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 <= 1332; 0 <= m <= 2664; 1 <= u,v <= n.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 1332; 0 <= m <= 2664; 1 <= u,v <= n.
