#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll r,x,y;
    cin >> r >> x >> y;
    ll po = x*x + y*y;
    ll res = 0;
    r *= r;
    res = po / r;
    //cout << res << endl;
    //cout << pow((ll)(sqrt(res)),2) << endl;
    if(pow((ll)(sqrt(res)),2) == res && po % r == 0){
        res = sqrt(res);
    }
    else {
        res = sqrt(res);
        res += 1;
        res = max(res,(ll)2);
    }
    cout << res << endl;
}
# include <cstdio>
int t[100],t_n=0;
bool b[12];
void work(int x) {
	int now=x;
	t[t_n++]=now; b[now]=true;
	while(!b[now*x%10]) now=now*x%10, b[now]=true, t[t_n++]=now;
}
int qpow(int x,int p,int mod) {
	int res=1;
	while(p) {
		if(p&1) res=1ll*res*x%mod;
		x=1ll*x*x%mod; p>>=1;
	}
	return (res-1+mod)%mod;
}
int main() {
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	work(a%10);
	printf("%d",t[qpow(b,c,t_n)]);
	return 0;
}