{"raw_statement":[{"iden":"problem statement","content":"You are given a simple undirected graph with $N$ vertices numbered $1$ to $N$ and $M$ edges numbered $1$ to $M$. Edge $i$ connects vertex $u_i$ and vertex $v_i$.  \nFind the number of connected components in this graph."},{"iden":"notes","content":"A **simple undirected graph** is a graph that is simple and has undirected edges.  \nA graph is **simple** if and only if it has no self-loop or multi-edge.\nA **subgraph** of a graph is a graph formed from some of the vertices and edges of that graph.  \nA graph is **connected** if and only if one can travel between every pair of vertices via edges.  \nA **connected component** is a connected subgraph that is not part of any larger connected subgraph."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 100$\n*   $0 \\leq M \\leq \\frac{N(N - 1)}{2}$\n*   $1 \\leq u_i, v_i \\leq N$\n*   The given graph is simple.\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$u_1$ $v_1$\n$u_2$ $v_2$\n$\\vdots$\n$u_M$ $v_M$"},{"iden":"sample input 1","content":"5 3\n1 2\n1 3\n4 5"},{"iden":"sample output 1","content":"2\n\nThe given graph contains the following two connected components:\n\n*   a subgraph formed from vertices $1$, $2$, $3$, and edges $1$, $2$;\n*   a subgraph formed from vertices $4$, $5$, and edge $3$.\n\n![image](https://img.atcoder.jp/ghi/abc284c_095531536446f41896b10cf15a3e4d158ce081ef1b6fe656788371718b39b3fb.jpg)"},{"iden":"sample input 2","content":"5 0"},{"iden":"sample output 2","content":"5"},{"iden":"sample input 3","content":"4 6\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4"},{"iden":"sample output 3","content":"1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}