PolandBall lives in a forest with his family. There are some trees in the forest. Trees are undirected acyclic graphs with k vertices and k-1 edges, where k is some integer. Note that one vertex is a valid tree.
There is exactly one relative living in each vertex of each tree, they have unique ids from 1 to n. For each Ball i we know the id of its most distant relative living on the same tree. If there are several such vertices, we only know the value of the one with smallest id among those.
How many trees are there in the forest?
Output
You should output the number of trees in the forest where PolandBall lives.
Interaction
From the technical side, this problem is interactive. However, it should not affect you (except hacking) since there is no interaction.
Note
In the first sample testcase, possible forest is:
1-2 3-4-5.
There are
2 trees overall.
In the second sample testcase, the only possible graph is one vertex and no edges. Therefore, there is only one tree.