import java.io.BufferedReader;
import java.io.InputStreamReader;


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);

		int cflag1=0;//?¬¬????????°??¨?¬¬????????°???????????¨????????°
		int cflag2=0;//?¬¬????????°??¨?¬¬????????°???????????¨????????°

		for(int i=0;i<div1.length;i++){
			if(div1[i]==div3[i]){
				cflag1++;
			}
		}
		for(int i=0;i<div2.length;i++){
			if(div2[i]==div3[i]){
				cflag2++;
			}
		}
		System.out.println(cflag1+cflag2);
	}

	//?¬¬????????°???????????????????????????
	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);
	}
}