def GCD(a, b): if b == 0: return a else: return GCD(b, a % b) def solve(A, B): g = GCD(A, B) a, b = A//g, B//g G *= GCD(a+b, g) G *= g return G A, B = map(int, input().split()) ans = solve(A, B) print(ans)