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