#include using namespace std; int main() { int A, B, C; cin >> A >> B >> C; auto f = []( int a, int b, int c ) -> bool { if( a == b || b== c || c == a ) return false; if( a < b && b > c || a > b && b < c ) return true; return false; }; if( f( A, B, C ) ) { cout << "INF" << endl; } else { int ans = 0; int ma = max( A, max( B, C ) ); for( int p = 1; p <= ma; p++ ) { if( f( A % p, B % p, C % p ) ) ans++; } cout << ans << endl; } }