There are $$$N$$$ planets in Vita's galaxy. In order to improve the security of the planets, Vita assigned each planet to guard exactly one other planet. In particular, the $$$i$$$-th planet guards the $$$A_i$$$-th planet for every $$$1 \le i \le N$$$.
Vita wants to construct a protective barrier surrounding multiple planets. Let the set of planets to be protected by the barrier be $$$S$$$, then each planet in $$$S$$$ must be guarding a planet not in $$$S$$$.
Help Vita determine the maximum number of planets to be protected by the barrier.
The first line of input contains an integer $$$N$$$ ($$$2 \leq N \leq 10^6$$$), the number of planets.
The second line contains $$$N$$$ integers. For every $$$1 \le i \le N$$$, $$$i$$$-th integer represents $$$A_i$$$ ($$$1 \le A_i \le N$$$, $$$A_i \ne i$$$), which means the $$$i$$$-th planet guards the $$$A_i$$$-th planet.
Output a single integer, the maximum number of planets in the protective barrier.
6 3 6 2 5 4 3
3