import math
n,m=map(int,input().split())
yue=math.gcd(n,m)
bei=n*m//yue
print(yue+bei)