
| Contests | Virtual Contests | Problems | Submit | Runs Status | Rank List | Forum |
Input
The input consists of several blocks of lines. Each block describes one network.
In the first line of each block there is the number of places N < 100. Each
of the next at most N lines contains the number of a place followed by the numbers
of some places to which there is a direct line from this place. These at most
N lines completely describe the network, i.e., each direct connection of two
places in the network is contained at least in one row. All numbers in one line
are separated by one space. Each block ends with a line containing just 0. The
last block has only one line with N = 0.
Output
The output contains for each block except the last in the input one line containing
the number of critical places.
Sample Input
5 5 1 2 3 4 0 6 2 1 3 5 4 6 2 0 0
Sample Output
1 2