#include using namespace std; int main(){ int A,B,n,c; int N = 0; n=0; c=0; cin>>A>>B; while(n==1){ N =A*N+B; c++; if(N==0){ n=1; } } }