Your software consists of packages and executables. Each method is Package::Method. Executables are packages whose method named PROGRAM starts running.
For every method you know which methods call it directly. A method is unused if no execution starting from any PROGRAM method can ever call it. Count unused methods.
Line 1: integer N (1≤N≤400), the number of methods. Each method occupies two lines: identifier and caller count ki, then optionally ki caller identifiers.
Print the number of unused methods.