Count sources#479

Count sources

1 second
128 megabytes
Very easy (≈850)

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 (1 ≤ n ≤ 100). 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.

Examples

Example 1

Loading
Loading