#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[100005];
long long lev[100005];
void dfs(long long u, long long dep) {
  long long v;
  lev[dep + 1] += adj[u].size();
  for (long long i = 0; i < adj[u].size(); i++) {
    v = adj[u][i];
    dfs(v, dep + 1);
  }
  return;
}
int main() {
  memset(lev, 0, sizeof lev);
  long long n;
  scanf("%lld", &n);
  long long a;
  for (long long i = 2; i <= n; i++) {
    scanf("%lld", &a);
    adj[a].push_back(i);
  }
  dfs(1, 0);
  long long ans = 0;
  for (long long i = 0; i <= n + 2; i++) {
    if (lev[i] % 2) ans++;
  }
  cout << ans + 1 << endl;
  return 0;
}
