#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;
#include<iostream>
#include<cstring>
#include<algorithm>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int P[100001];
int sei[100001], fu[100001], kisuu[100001], kazu[100001], kazu2[100001];

void sort_ganbare(int N, int A[]) {
	if (N < (1 << 12)) {
		sort(A, A + N);
		return;
	}
	const int b = 9;
	int tmp[100001];
	int kazu[1 << b] = {}, kazu2[1 << b] = {};
	rep(i, N) kazu[A[i] & ((1 << b) - 1)]++;
	rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
	for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] & ((1 << b) - 1)]] = A[i];
	rep(i, N) kazu2[tmp[i] >> b & ((1 << b) - 1)]++;
	rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
	for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> b & ((1 << b) - 1)]] = tmp[i];
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int N;
	cin >> N;
	rep1(i, N - 1) {
		cin >> P[i + 1];
		kazu[P[i + 1]]++;
	}
	rep(i, N) kazu2[i + 1] = (kazu[i + 1] += kazu[i]);

	for (int i = N; i >= 2; i--) {
		int ret = sei[i] - 1;

		auto ki = kisuu + kazu[i - 1];
		int sz = kazu2[i - 1] - kazu[i - 1];
		sort_ganbare(sz, ki);

		if (sz & 1) {
			ret -= fu[i];
			rep(j, sz) {
				if (j & 1) ret -= ki[j] - (1 << 17);
				else ret += ki[j] - (1 << 17);
			}
		}
		else {
			ret += fu[i];
			rep(j, sz) {
				if (j & 1) ret += ki[j] - (1 << 17);
				else ret -= ki[j] - (1 << 17);
			}
		}

		if (ret & 1) {
			kisuu[kazu2[P[i] - 1]++] = ret + (1 << 17);
		}
		else {
			if (ret >= 0) sei[P[i]] += ret;
			else fu[P[i]] += ret;
		}
	}

	int ret = sei[1] - 1;

	auto ki = kisuu + kazu[0];
	int sz = kazu2[0] - kazu[0];
	sort_ganbare(sz, ki);

	if (sz & 1) {
		ret -= fu[1];
		rep(j, sz) {
			if (j & 1) ret -= ki[j] - (1 << 17);
			else ret += ki[j] - (1 << 17);
		}
	}
	else {
		ret += fu[1];
		rep(j, sz) {
			if (j & 1) ret += ki[j] - (1 << 17);
			else ret -= ki[j] - (1 << 17);
		}
	}

	co((N - ret) / 2);

	Would you please return 0;
}
//QwQcOrZ yyds!!!
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
#define ll long long
#define F(i,a,b) for (int i=(a);i<=(b);i++)
#define R(i,a,b) for (int i=(a);i<(b);i++)
#define D(i,a,b) for (int i=(a);i>=(b);i--)
#define go(i,x) for (int i=head[x];i;i=e[i].nx)
#define mp make_pair
#define pb push_back
#define pa pair < int,int >
#define fi first
#define se second
#define re register
#define be begin()
#define en end()
#define sqr(x) ((x)*(x))
#define ret return puts("-1"),0;
#define put putchar('\n')
#define inf 1000000005
#define mod 998244353
#define int ll
//#define N
using namespace std;
inline char gc(){static char buf[100000],*p1=buf,*p2=buf;return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;}
#define gc getchar
inline ll read(){char c=gc();ll su=0,f=1;for (;c<'0'||c>'9';c=gc()) if (c=='-') f=-1;for (;c>='0'&&c<='9';c=gc()) su=su*10+c-'0';return su*f;}
inline void write(ll x){if (x<0){putchar('-');write(-x);return;}if (x>=10) write(x/10);putchar(x%10+'0');}
inline void writesp(ll x){write(x),putchar(' ');}
inline void writeln(ll x){write(x);putchar('\n');}
long long x,y,z,p;
signed main()
{
	x=read(),y=read(),z=read();
	p=y*y+z*z;
	if (sqrt(p*1.0)/x<1) writeln(2); else
	cout<<ceil(sqrt(p*1.0)/x);
}
/*

*/

