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.
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.
Print one number — the minimum number of kiosks that are planned to be installed.
2 2 school station 2 station school
2