#include #include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) #define Inf 1000000001 int main(){ int n; cin>>n; vector> E(n); rep(i,n-1){ int p; cin>>p; p--; E[p].push_back(i+1); } int cnt = n-1; cnt -= E[0].size(); cout<