import math n,a,b=map(int,input().split()); print(math.ceil(n/a)+math.ceil(n/b)-math.ceil(n/math.lcm(a,b)));