{$apptype console} uses math; var rez,n,m:int64; i:char; begin assign(input,'SQUARE.dat'); reset(input); readln(n,m); close(input); rez:=0; while (n>0) and (m>0) do begin if n>m then begin rez:=rez+n div m;n:=n mod m;end else begin rez:=rez+m div n;m:=m mod n;end; end; assign(output,'SQUARE.sol'); rewrite(output); writeln(rez); close(output); end.