#python3题解# def getInnerNum(a, b): return getInnerNum(b, a % b) if b else a def getOuterNum(a, b, innerNum): return a // innerNum * b x, y = map(int, input().split()) innerNum = getInnerNum(min(x,y), max(x,y)) outerNum = getOuterNum(x, y, innerNum) print(innerNum + outerNum)