Kill All Termites

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

A tree is an undirected connected graph with nn vertices and n1n - 1 edges.

You are given a tree. There are termites in some vertices of this tree. Your task is to kill them all. To do so, you can poison some of the vertices. If a termite visits a poisoned vertex, it immediately dies. Every second, each termite moves to an adjacent vertex. A termite cannot move along the same edge twice in a row, except when it gets into a leaf. Find the minimal possible number of vertices you can poison so that all the termites will eventually die, regardless of their initial positions and strategies.

입력

The first line contains one integer nn, the size of the tree (1n100,0001 \le n \le 100\\,000).

The second line contains n1n - 1 integers p_2,p_3,,p_np\_2, p\_3, \ldots, p\_{n}, meaning that there is an edge between vertices ii and p_ip\_i for 2in2 \le i \le n (1p_i<i1 \le p\_i < i).

출력

Print one integer: the answer.