#include <bits/stdc++.h>
using namespace std;
const int maxn = 100011;
int dep[maxn], s[maxn];
int main() {
  int n;
  scanf("%d", &n);
  dep[1] = 1;
  for (int i = 2, f; i <= n; ++i) scanf("%d", &f), s[dep[i] = dep[f] + 1] ^= 1;
  int ans = 1;
  for (int i = 1; i <= n; ++i) ans += s[i];
  printf("%d\n", ans);
  return 0;
}
