import java.io.BufferedReader;
import java.io.InputStreamReader;
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));//?¬¬????????°

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

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

		for (int i = 0; i < div1.length; i++) {
			if (div1[i] == div3[i]) {
				set.add(div1[i]);
			}
		}
		for (int i = 0; i < div2.length; i++) {
			if (div2[i] == div3[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 int[] getDivisor(int num) {
		int dnum = getDnum(num);
		int getNum[] = new int[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);
	}
}