#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[100005];
long long int vis[100005] = {};
long long int l[100005] = {};
long long int maxi = INT_MIN;
void dfs(long long int x, long long int level) {
  vis[x] = 1;
  maxi = max(maxi, level);
  if (adj[x].size() % 2 == 1) l[level]++;
  for (auto it : adj[x]) {
    if (!vis[it]) {
      vis[it] = 1;
      dfs(it, level + 1);
    }
  }
}
void solve() {
  long long int n, m, x, y;
  cin >> n;
  for (long long int i = 2; i < n + 1; i++) {
    cin >> x;
    adj[x].push_back(i);
  }
  long long int ans = 1;
  dfs(1, 1);
  for (long long int i = 1; i < n + 5; i++) {
    if (l[i] % 2 == 1) {
      ans++;
    }
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
