import math
t,a,b = list(map(int, input().split()))
g = a // math.gcd(a,b) * b
ans = (t+a-1)//a + (t+b-1)//b - (t+g-1)//g
print(ans)