Find the number of connected components in a graph given by its adjacency list.
The first line contains the number of vertices (1 \le n \le 10000). Each of the next lines describes the outgoing edges from the -th vertex. Each line begins with the number of outgoing edges, followed by the vertex numbers to which these edges go. All vertices are numbered from to .
Print the number of connected components in the graph.

Beispiel 1