Vani runs the apothecary at the lantern lake of Firefly Mere. Today the books show a list of canals, and the numbers must be worked out before sundown. 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 <= 1727; 0 <= m <= 3454; 1 <= u,v <= n.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 1727; 0 <= m <= 3454; 1 <= u,v <= n.
