fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: Vec = s.split_whitespace().flat_map(str::parse).collect(); let (a, b, c) = (n[0], n[1], n[2]); let m = a.max(b).max(c); if a == b || b == c || c == a { println!("0"); return; } if b == m || b == a.min(b).min(c) { println!("INF"); return; } let a = (2..=m) .filter(|i| { let (a, b, c) = (a % i, b % i, c % i); a != b && b != c && c != a && (b == a.max(b).max(c) || b == a.min(b).min(c)) }) .count(); println!("{}", a) }