from math import lcm T, A, B = map(int, input().split()) def f(x): return (T-1)//x + 1 ans = f(A) + f(B) - f(lcm(A, B)) print(ans)