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