#include <bits/stdc++.h>
using namespace std;
vector<long long> v[100010];
long long dp[100010];
void dfs(long long i, long long first) {
  dp[first]++;
  for (auto x : v[i]) {
    dfs(x, first + 1);
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    long long x;
    cin >> x;
    v[x].push_back(i);
  }
  long long ans = 0;
  dfs(1, 1);
  for (long long i = 1; i <= n; i++) {
    ans += (dp[i] % 2);
  }
  cout << ans << endl;
  return 0;
}
