// i wants to take ioi
//binhtinhtutinkhongcaycunhungmotkhikhongcontutinnualatuyetvong
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define nn "\n"
#define pi pair<int, int>
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define eb emplace_back
#define pb push_back
#define TASK "Haidtron"

#define ms(a, x) memset(a, x, sizeof(a))
#define all(a) a.begin(), a.end()
#define All(a, n) a + 1, a + 1 + n

#define LOG 19

const int INF = 1e18;
const int mod = 1e9;
const int N = 1e5 + 5;
const int MOD = 998244353;

int bit[200000];
int x, y, r, ax, ay, bx, by;
void nhap(){
    cin >> x >> y >> r;
    cin >> ax >> ay >> bx >> by;
}
int kc2(int a, int b, int c, int d){
    return (a - c) * (a - c) + (b - d) * (b - d);
}
void solve(){
    int r2 = r * r;
    int da2 = kc2(ax, ay, x, y);
    int db2 = kc2(bx, by, x, y);
    int ab2 = kc2(ax, ay, bx, by);
    if(da2 <= r2 && db2 <= r2){
        cout << 3 << nn;
        return;
    }
    if(ab2 == 0){
        cout << 4 << nn;
        return;
    }
    int vx = bx - ax;
    int vy = by - ay;
    int t = (x - ax) * vx + (y - ay) * vy;
    int kc_tam2 = 0;
    if(t <= 0){
        kc_tam2 = da2;
        if(kc_tam2 > r2) cout << 4 << nn;
        else if(kc_tam2 == r2) cout << 1 << nn;
        else cout << 2 << nn;
    }
    else if(t >= ab2){
        kc_tam2 = db2;

        if(kc_tam2 > r2) cout << 4 << nn;
        else if(kc_tam2 == r2) cout << 1 << nn;
        else cout << 2 << nn;
    }
    else{
        int cross = vx * (y - ay) - vy * (x - ax);
        int lhs = cross * cross;
        int rhs = r2 * ab2;
        if(lhs > rhs) cout << 4 << nn;
        else if(lhs == rhs) cout << 1 << nn;
        else cout << 2 << nn;
    }
}

signed main(){
    if(fopen(TASK".inp", "r")){
        freopen(TASK".inp", "r", stdin);
        freopen(TASK".out", "w", stdout);
    }
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    nhap();
    solve();
    return (0 ^ 0);
}