c;main(a,b){for(scanf("%d%d",&a,&b);a-b;c++)a>b?a-=b:(a^=b^=a^=b);printf("%d",c);}