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