#include <bits/stdc++.h>
using namespace std;
const int OO = 0x3f3f3f3f, SIZE = 1e5 + 5;
int n, ans = 1, x;
vector<int> adj[SIZE];
void BFS() {
  queue<int> q;
  q.push(1);
  while (q.size()) {
    int cnt = q.size(), sz = 0;
    while (cnt--) {
      int p = q.front();
      q.pop();
      for (int ch : adj[p]) {
        q.push(ch);
        ++sz;
      }
    }
    if (sz % 2) ++ans;
  }
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &x);
    adj[x].push_back(i);
  }
  BFS();
  cout << ans << "\n";
  return 0;
}
