'''
for循环的条件“for in range(2,min(m,n)+1):”里的m,n不会受到循环内容“m=m//i n=n//i”影响
例如:
w=[1,2]
for i in w:
w=[3,4]
print(i)
>>
1
思路借用一下大佬的图:
'''
m, n = list(map(int, input().split( )))
T=1
for i in range(2,min(m,n)+1):
while m%i==0 and n%i==0: ##重点,直到2不行了在换3...
T=T*i
m=m//i
n=n//i
print(T*m*n)
for循环的条件“for in range(2,min(m,n)+1):”里的m,n不会受到循环内容“m=m//i n=n//i”影响
例如:
w=[1,2]
for i in w:
w=[3,4]
print(i)
>>
1
2
'''
m, n = list(map(int, input().split( )))
T=1
for i in range(2,min(m,n)+1):
while m%i==0 and n%i==0: ##重点,直到2不行了在换3...
T=T*i
m=m//i
n=n//i
print(T*m*n)