eolymp
bolt
Try our new interface for solving problems
Problems

Count sources

Count sources

The directed graph is given with the adjacency list. The vertex of directed graph is called a source if no edge comes into it. Count the number of sources in the graph.

Input

First line contains the number of vertices n (1n100). The next i-th line contains the number of edges adjacent to the i-th vertex, and the vertex numbers where these edges go in increasing order.

Output

Print the number of sources in the graph.

prb10482.gif

Example

Graph contains 1 source - the vertex number 4.

Time limit 1 second
Memory limit 128 MiB
Input example #1
5
1 3
2 1 3
1 5
2 1 2
2 1 2
Output example #1
1
Author Michael Medvedev