import math L = raw_input().split() A = int(L[0]) B = int(L[1]) S = A + B P = A * B def greatest_common_dicisor(x,y): if x < y: temp = x x = y y = temp r = x % y while r > 0: x = y y = r r = x % y return y print greatest_common_dicisor(S,P)