A,B=map(int,input().split()) from math import gcd N=gcd(A,B) ans=0 for i in range(1,N): if i**2>N: break else: if N%i==0: if i**2