#include <bits/stdc++.h>
using namespace std;
vector<bool> v(101234);
vector<int> g[101234];
void dfs(int pos, int level) {
  v[level] = v[level] ^ 1;
  for (auto i : g[pos]) {
    dfs(i, level + 1);
  }
}
int main() {
  int n, x;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> x;
    g[x].push_back(i + 1);
  }
  dfs(1, 1);
  int ans = 0;
  for (auto i : v) {
    ans += i;
  }
  cout << ans;
  return 0;
}
