import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

class Main {
	public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();

		int x = Integer.parseInt(SubStringStart(str));//?¬¬????????°
		int y = Integer.parseInt(SubStringMid(str));//?¬¬????????°
		int z = Integer.parseInt(SubStringEnd(str));//?¬¬????????°

//		Integer[] div1 = getDivisor(x);
//		Integer[] div2 = getDivisor(y);
		Integer[] div3 = getDivisor(z);

		Set<Integer> set = new HashSet<>();

		for (int i = x; i <= y; i++) {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		}
//		for (int i = 0; i < div2.length; i++) {
//			if (Arrays.asList(div3).contains(div2[i])) {
//				set.add(div2[i]);
//			}
//		}

		System.out.println(set.size());
	}

	//?¬¬????????°???????????????????????????
	public static String SubStringStart(String str) {
		int index = str.indexOf(" ");
		return (str.substring(0, index));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringEnd(String str) {
		int index = str.lastIndexOf(" ");
		return (str.substring(index + 1));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringMid(String str) {
		int index1 = str.indexOf(" ");
		int index2 = str.lastIndexOf(" ");
		return (str.substring(index1 + 1, index2));
	}

	//?????°????´???°???????????????????????????
	public static Integer[] getDivisor(int num) {
		int dnum = getDnum(num);
		Integer[] getNum = new Integer[dnum];
		int dflag = 0;
		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		}
		return (getNum);
	}

	//?´???°?????°???????????????????????????
	public static int getDnum(int num) {
		int dflag = 0;

		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				dflag++;
			}
		}
		return (dflag);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util class Main {
	public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();

		int x = Integer.parseInt(SubStringStart(str));//?¬¬????????°
		int y = Integer.parseInt(SubStringMid(str));//?¬¬????????°
		int z = Integer.parseInt(SubStringEnd(str));//?¬¬????????°

//		Integer[] div1 = getDivisor(x);
//		Integer[] div2 = getDivisor(y);
		Integer[] div3 = getDivisor(z);

		Set<Integer> set = new HashSet<>();

		for (int i = x; i <= y; i++) {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		}
//		for (int i = 0; i < div2.length; i++) {
//			if (Arrays.asList(div3).contains(div2[i])) {
//				set.add(div2[i]);
//			}
//		}

		System.out.println(set.size());
	}

	//?¬¬????????°???????????????????????????
	public static String SubStringStart(String str) {
		int index = str.indexOf(" ");
		return (str.substring(0, index));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringEnd(String str) {
		int index = str.lastIndexOf(" ");
		return (str.substring(index + 1));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringMid(String str) {
		int index1 = str.indexOf(" ");
		int index2 = str.lastIndexOf(" ");
		return (str.substring(index1 + 1, index2));
	}

	//?????°????´???°???????????????????????????
	public static Integer[] getDivisor(int num) {
		int dnum = getDnum(num);
		Integer[] getNum = new Integer[dnum];
		int dflag = 0;
		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		}
		return (getNum);
	}

	//?´???°?????°???????????????????????????
	public static int getDnum(int num) {
		int dflag = 0;

		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				dflag++;
			}
		}
		return (dflag);
	}
} Main public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();

		int x = Integer.parseInt(SubStringStart(str));//?¬¬????????°
		int y = Integer.parseInt(SubStringMid(str));//?¬¬????????°
		int z = Integer.parseInt(SubStringEnd(str));//?¬¬????????°

//		Integer[] div1 = getDivisor(x);
//		Integer[] div2 = getDivisor(y);
		Integer[] div3 = getDivisor(z);

		Set<Integer> set = new HashSet<>();

		for (int i = x; i <= y; i++) {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		}
//		for (int i = 0; i < div2.length; i++) {
//			if (Arrays.asList(div3).contains(div2[i])) {
//				set.add(div2[i]);
//			}
//		}

		System.out.println(set.size());
	} main {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();

		int x = Integer.parseInt(SubStringStart(str));//?¬¬????????°
		int y = Integer.parseInt(SubStringMid(str));//?¬¬????????°
		int z = Integer.parseInt(SubStringEnd(str));//?¬¬????????°

//		Integer[] div1 = getDivisor(x);
//		Integer[] div2 = getDivisor(y);
		Integer[] div3 = getDivisor(z);

		Set<Integer> set = new HashSet<>();

		for (int i = x; i <= y; i++) {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		}
//		for (int i = 0; i < div2.length; i++) {
//			if (Arrays.asList(div3).contains(div2[i])) {
//				set.add(div2[i]);
//			}
//		}

		System.out.println(set.size());
	} InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader br = new BufferedReader(is); br new BufferedReader(is) String str = br.readLine(); str br.readLine() br.readLine br int x = Integer.parseInt(SubStringStart(str)); x Integer.parseInt(SubStringStart(str)) Integer.parseInt Integer SubStringStart(str) SubStringStart str int y = Integer.parseInt(SubStringMid(str)); y Integer.parseInt(SubStringMid(str)) Integer.parseInt Integer SubStringMid(str) SubStringMid str int z = Integer.parseInt(SubStringEnd(str)); z Integer.parseInt(SubStringEnd(str)) Integer.parseInt Integer SubStringEnd(str) SubStringEnd str Integer[] div3 = getDivisor(z); div3 getDivisor(z) getDivisor z Set<Integer> set = new HashSet<>(); set new HashSet<>() for (int i = x; i <= y; i++) {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		} int i = x; int i = x; i x i <= y i y i++ i++ i {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		} {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		} if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			} Arrays.asList(div3).contains(i) Arrays.asList(div3).contains Arrays.asList(div3) Arrays.asList Arrays div3 i {
				set.add(i);
			} set.add(i) set.add set i System.out.println(set.size()) System.out.println System.out System System.out set.size() set.size set String[] args args //?¬¬????????°???????????????????????????
	public static String SubStringStart(String str) {
		int index = str.indexOf(" ");
		return (str.substring(0, index));
	} SubStringStart {
		int index = str.indexOf(" ");
		return (str.substring(0, index));
	} int index = str.indexOf(" "); index str.indexOf(" ") str.indexOf str " " return (str.substring(0, index)); (str.substring(0, index)) str.substring str 0 index String str str //	?¬¬????????°???????????????????????????
	public static String SubStringEnd(String str) {
		int index = str.lastIndexOf(" ");
		return (str.substring(index + 1));
	} SubStringEnd {
		int index = str.lastIndexOf(" ");
		return (str.substring(index + 1));
	} int index = str.lastIndexOf(" "); index str.lastIndexOf(" ") str.lastIndexOf str " " return (str.substring(index + 1)); (str.substring(index + 1)) str.substring str index + 1 index 1 String str str //	?¬¬????????°???????????????????????????
	public static String SubStringMid(String str) {
		int index1 = str.indexOf(" ");
		int index2 = str.lastIndexOf(" ");
		return (str.substring(index1 + 1, index2));
	} SubStringMid {
		int index1 = str.indexOf(" ");
		int index2 = str.lastIndexOf(" ");
		return (str.substring(index1 + 1, index2));
	} int index1 = str.indexOf(" "); index1 str.indexOf(" ") str.indexOf str " " int index2 = str.lastIndexOf(" "); index2 str.lastIndexOf(" ") str.lastIndexOf str " " return (str.substring(index1 + 1, index2)); (str.substring(index1 + 1, index2)) str.substring str index1 + 1 index1 1 index2 String str str //?????°????´???°???????????????????????????
	public static Integer[] getDivisor(int num) {
		int dnum = getDnum(num);
		Integer[] getNum = new Integer[dnum];
		int dflag = 0;
		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		}
		return (getNum);
	} getDivisor {
		int dnum = getDnum(num);
		Integer[] getNum = new Integer[dnum];
		int dflag = 0;
		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		}
		return (getNum);
	} int dnum = getDnum(num); dnum getDnum(num) getDnum num Integer[] getNum = new Integer[dnum]; getNum new Integer[dnum] dnum int dflag = 0; dflag 0 for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		} int i = 1; int i = 1; i 1 i < num + 1 i num + 1 num 1 i++ i++ i {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		} {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		} if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			} num % i == 0 num % i num i 0 {
				getNum[dflag] = i;
				dflag++;
			} getNum[dflag] = i getNum[dflag] getNum dflag i dflag++ dflag return (getNum); (getNum) int num num //?´???°?????°???????????????????????????
	public static int getDnum(int num) {
		int dflag = 0;

		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				dflag++;
			}
		}
		return (dflag);
	} getDnum {
		int dflag = 0;

		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				dflag++;
			}
		}
		return (dflag);
	} int dflag = 0; dflag 0 for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				dflag++;
			}
		} int i = 1; int i = 1; i 1 i < num + 1 i num + 1 num 1 i++ i++ i {
			if (num % i == 0) {
				dflag++;
			}
		} {
			if (num % i == 0) {
				dflag++;
			}
		} if (num % i == 0) {
				dflag++;
			} num % i == 0 num % i num i 0 {
				dflag++;
			} dflag++ dflag return (dflag); (dflag) int num num
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

class Main {
	public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();

		int x = Integer.parseInt(SubStringStart(str));//?¬¬????????°
		int y = Integer.parseInt(SubStringMid(str));//?¬¬????????°
		int z = Integer.parseInt(SubStringEnd(str));//?¬¬????????°

//		Integer[] div1 = getDivisor(x);
//		Integer[] div2 = getDivisor(y);
		Integer[] div3 = getDivisor(z);

		Set<Integer> set = new HashSet<>();

		for (int i = x; i <= y; i++) {
//			System.out.println("?????°="+i);
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		}
//		for (int i = 0; i < div2.length; i++) {
//			if (Arrays.asList(div3).contains(div2[i])) {
//				set.add(div2[i]);
//			}
//		}

		System.out.println(set.size());
	}

	//?¬¬????????°???????????????????????????
	public static String SubStringStart(String str) {
		int index = str.indexOf(" ");
		return (str.substring(0, index));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringEnd(String str) {
		int index = str.lastIndexOf(" ");
		return (str.substring(index + 1));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringMid(String str) {
		int index1 = str.indexOf(" ");
		int index2 = str.lastIndexOf(" ");
		return (str.substring(index1 + 1, index2));
	}

	//?????°????´???°???????????????????????????
	public static Integer[] getDivisor(int num) {
		int dnum = getDnum(num);
		Integer[] getNum = new Integer[dnum];
		int dflag = 0;
		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		}
		return (getNum);
	}

	//?´???°?????°???????????????????????????
	public static int getDnum(int num) {
		int dflag = 0;

		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				dflag++;
			}
		}
		return (dflag);
	}
}