import java.awt.List;
import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.StringTokenizer;

import javax.management.Query;

public class supper_nk {

	BufferedReader in;
	StringTokenizer str;
	PrintWriter out;

	String next() throws IOException {
		String help;
		while ((str == null) || (!str.hasMoreTokens())) {
			help = in.readLine();
			if (help == null) {
				return null;
			}
			str = new StringTokenizer(help);
		}
		return str.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	public int gcd(int x, int y) {
		return (y == 0 ? x : gcd(y, x % y));
	}

	public boolean check(int x, int y, int r, int cx, int cy) {
		return ((cx - x) * (cx - x) + (cy - y) * (cy - y) <= r * r);
	}

	public void solve() throws IOException {
		in = new BufferedReader(new FileReader("supper.in"));
		out = new PrintWriter("supper.out");
		double x = nextInt();
		double y = nextInt();
		double r = nextInt();
		double tx = nextInt() - x;
		double ty = nextInt() - y;
		double px = nextInt() - x;
		double py = nextInt() - y;
		double vx = px - tx;
		double vy = py - ty;
		double g = gcd(Math.abs((int)vx), Math.abs((int)vy));
		vx = vx/g;
		vy = vy/g;
		double a = py - ty;
		double b = tx -px;
		double c = -a*px - b*py;
		double x0 = -a*c/(a*a+b*b),  y0 = -b*c/(a*a+b*b);
		if (c*c > r*r*(a*a+b*b))
			out.print(0);
		else if (Math.abs (c*c - r*r*(a*a+b*b)) == 0) {
				int ai = (int) a;
			int bi = (int) b;
			int ci = (int) c;
			
			if ((-ai*ci) % (ai*ai+bi*bi)==0 && (-bi*ci)%(ai*ai+bi*bi) == 0)
				out.println(1);
			else out.print(0);
		}
		else {
			double d = r*r - c*c/(a*a+b*b);
			double mult = Math.sqrt (d / (a*a+b*b));
			double ax,ay,bx,by;
			ax = x0 + b * mult;
			bx = x0 - b * mult;
			ay = y0 - a * mult;
			by = y0 + a * mult;
			int l1 = (int) Math.ceil((ax-tx)/vx);
			int l2 = (int) Math.floor((bx-tx)/vx);
			//int p = (int) ((px-tx)/vx);
			out.println(l2 - l1 + 1);
		}		
		out.close();
	}

	static void myAssert(boolean b, String string) {
		if (!b) {
			throw new AssertionError(string);
		}
	}

	public static void main(String[] args) throws IOException {
		new supper_nk().solve();
	}
}