#include #include int func(int a,int b){ while(1){ int r=a%b; if(r==0)return b; a=b; b=r; } } int main(){ int a,b; std::cin>>a>>b; int m=func(a,b); a/=m; b/=m; int count=0; while(1){ if(a>b){ a-=b; }else{ int tmp=a; a=b; b=tmp; } count++; if(a==b){ break; } } std::cout<