import sequtils,strutils var N,M : int cnt,p,m : int (M, N) = stdin.readline.split.map(parseInt) while N != M: if M > N: p = M div N m = M mod N cnt += p if m == 0: M = N cnt -= 1 else: M = m if M < N: (M, N) = (N, M) cnt += 1 echo cnt