m,n = list(map(int,input().split()))
x = m
y = n
r = m % n
while r != 0:
    m = n
    n = r
    r = m % n

e = x*y//n
print(e+n)