package main

import "fmt"

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)

	nd := 1

	for i := 2; i < b; i++ {
		if a%i == 0 && c%i == 0 {
			nd++
		}
		if b%i == 0 && c%i == 0 {
			nd++
		}
	}

	fmt.Println(nd)
}

