T, A, B = map(int, input().split()) from math import gcd def lcm(x, y): return x*y // gcd(x, y) def ceil(a, b): return (a+b-1) // b ans = ceil(T, A) + ceil(T, B) - ceil(T, lcm(A, B)) print(ans)