#include using namespace std; typedef long long ll; #define reps(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) reps(i,0,n) #define all(x) (x).begin(),(x).end() #define INF (1000000001) #define MOD (1000000007) #define PI (acos(-1)) int main(){ int N,K; cin >> N >> K; if(N==0){ if(K==0)cout << 1 << endl; else cout << "INF" << endl; return 0; } int M = N; reps(i,8,20){ M &= ~(1<=K && x&&y==M)cnt++; } } cout << cnt << endl; }