#include using namespace std; bool isKadomatsu(int a, int b, int c){ if(a != b && a != c && b != c){ if(a < b){ if(b > c){ // cout << a << b << c << endl; return true; } }else if(a > b){ if(b < c){ // cout << a << b << c << endl; return true; } } } return false; } int main(){ int a, b, c; cin >> a >> b >> c; int count = 0; if(a == 1 || b == 1 || c == 1){ cout << "INF" << endl; }else{ for(int i = 1; i <= max(max(a, b), c); i++){ if(isKadomatsu(a % i, b % i, c % i) == true) count++; } cout << count << endl; } }