Description
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.
Input
The input consists of several test cases, each starts with a line containing 0
Output
The input consists of several test cases, each starts with a line containing 0
1 0
7 4
01 2 02 03
06 1 07
02 2 04 05
03 1 06
0 0