#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define e(v) sort(v.begin(), v.end())
#define rev(v) reverse(v.begin(), v.end())
#define out(s) cout << s << endl
#define decimal10(s) cout << fixed << setprecision(10) << s << endl;
typedef long long ll;
using Graph = vector<vector<int>>;
const int MOD = 1000000007;
 int main(){
   float a, b;
   cin >> a >> b;
   float c = 100.0 - (b / a) * 100;
   decimal10(c);
 }

#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define ford(i,n) for(int i=n-1;i>=0;i--)
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pib pair<int,bool>
#define vi vector<int>
#define ll long long
#define vll vector<ll>
#define sz(s) (int)(s.size())
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vib vector<pib>
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
string i_t_s(int x){
	string t="";
	while(x){
		t+=x%10+'0';
		x/=10;
	}
	reverse(all(t));
	re t;
}
int s_t_i(string t){
	int x=0;
	rep(i,sz(t)){
		x=x*10+(t[i]-'0');
	}
	re x;
}
ll q_p(ll x,ll y){
	ll res=1;
	x%=mod;
	while(y){
		if(y%2){
			res=res*x;
			res%=mod;
		}
		y/=2;
		x=x*x;
		x%=mod;
	}
	re res;
}
vi v[100001];
int n;
int p;
pib ans(int x){
	ll now=0,s1=0,s2=0;
	vi e;
	bool f=1;
	rep(i,sz(v[x])){
		pib nn=ans(v[x][i]);
		if(nn.se){
			e.pb(nn.fr);
			 f^=1;
		}else{
			if(nn.fr>0)
			s1+=nn.fr;
			else
			s2+=nn.fr;
		}
	}
	sort(all(e));
	now++;
	now+=s2;
	rep(i,sz(e)){
		if(i%2){
			now-=e[i];
		}else
		now+=e[i];
	}
	if(sz(e)%2)
	now-=s1;
	else
	now+=s1;
	re m_p(now,f);
}
int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	forn(i,1,n){
		cin>>p;
		p--;
		v[p].pb(i);
	}
	cout<<(ans(0).fr+n)/2;
	re 0;
}
/*
检查循环是rep(i,n)还是rep(i,m)!!
long long所要的时间比int长!!
没有long long必要不写long long!!
*/
