#include<bits/stdc++.h> using namespace std; int n , x; int main(){ cin >> x >> n; if(x >= (1 << n)){ cout << 0; } else{ if(n == 2){ cout << 1; } else{ if(x == 2) cout << "inf"; else cout <<ceil(log2((n - 2) / log2(x) - 1)); } } return 0; }