#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100000 + 453];
int ans = 0;
int depth[100000 + 453];
int solve(int x) {
  int ans = 0;
  for (int i = 0; i < (int)adj[x].size(); i++) {
    ans = max(ans, solve(adj[x][i]));
  }
  return ans + 1;
}
int main() {
  ios::sync_with_stdio(false);
  int n, x;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> x;
    adj[x].push_back(i);
  }
  queue<pair<int, int> > q;
  q.push(make_pair(1, 1));
  while (q.empty() == 0) {
    pair<int, int> topp = q.front();
    q.pop();
    depth[topp.second]++;
    for (int i = 0; i < (int)adj[topp.first].size(); i++) {
      q.push(make_pair(adj[topp.first][i], topp.second + 1));
    }
  }
  int count = 0;
  for (int i = 0; i <= 100000; i++) {
    count += depth[i] % 2;
  }
  cout << count;
  return 0;
}
