In the event of technical difficulties with Szkopuł, please contact us via email at szkopul@fri.edu.pl.

If you are familiar with IRC chat, the support team is also reachable on PIRC network (`irc.pirc.pl`

) in `#szkopul`

channel. If you are not, just use email.

Please do not ask us things like "how to solve task XYZ?".

Please remember that the support team has to sleep sometimes or go to work in real life.

Byteotian Intelligence Agency (BIA) employs many spies. Each of them has duty to shadow exactly one other spy.

King Byteasar wants to entrust as many agents as possible with a top secret operation. However, the operation is so important that each spy taking part has to be traced by at least one agent not involved in the operation (assignment of shadowing BIA spies does not change).

Write a programme that:

- reads from standard input the description of whom each spy shadows,
- calculates how many agents can be assigned to the operation in a way that each of them would be spied by at least one agent not taking part in the operation,
- writes the result to the standard output.

In the first line of the input there is one positive integer written, - the number of spies, . The spies are numbered from to . In the following lines there is a description of whom each agent spies. Each of these lines contains one positive integer. A number situated in line no. indicates, that the spy no. shadows the spy no. , , , .

Your programme should write one integer in the first line of the output - the maximal number of spies that can be assigned to the secret operation.

For the input data:

6 2 3 l 3 6 5

the correct result is:

3

*Task author: Pawel Parys.*