English version is in beta. All contents of the site should be already translated (mostly using machine translation), and everything should work properly. However, if you find any problems, please contact me.
The problem statement has been automatically translated from Russian. If the statement is not clear, or you have any comments about it, please contact me. Anyway, I hope that someday I will fix the translation manually.

Ice cream kiosks

In a small provincial town there is a small school where not very big children study. After classes, they run to the bus stop, from where the bus takes them home.

On the way from the school to the bus stop there are N intersections connected by streets. Schoolchildren cross from street to street only at intersections.

All schoolchildren, as you know, love ice cream. The well-known company Cold-N-Icy, which produces ice cream, decided to take advantage of this. She wants to place ice cream kiosks at some intersections in such a way that any student's path from school to the bus stop passes through at least one intersection where the kiosk is installed.

Since the installation and maintenance of a kiosk is expensive, the company decided to involve you in order to determine the minimum number of kiosks that need to be installed.

Help Cold-N-Icy to find this minimum number.

Input data

The first line of the input file contains the number of intersections N (1 ≤ N ≤ 100).

Each of the following N lines contains information about intersections connected by streets. Intersections are numbered starting from one. At the beginning of the i-th line is the number Ki – the number of places (intersections, schools or stops) connected by streets with the i-th intersection. Next comes Ki places separated by spaces. To designate intersections, their numbers are used, the school is designated as school, the stop is designated as station.

If intersection i is in the list of intersection j, then the converse is also true.

It is guaranteed that there is always a way from the school to the bus stop.

Output data

Print one number — the minimum number of kiosks that are planned to be installed.

Examples
Input data
2
2 school station
2 station school
Output data
2

This problem on informatics