Number of loops#10505

Number of loops

1 second
128 megabytes
Easy

A simple directed graph is given by its adjacency list. Compute the number of loops in this graph.

Input

The first line contains the number of vertices n~(1 \le n \le 100). Each of the following lines contains the description of all edges outgoing from vertex . The description begins with the number of outgoing edges, followed by the list of vertices to which these edges go. All vertices are numbered with integers from to .

Output

Print the number of loops in the graph.

Examples

Example 1

Loading
Loading