import math m,n=map(int,input().split()) g=math.gcd(m,n) m//=g n//=g ans=0 if m