T, A, B = map(int, input().split()) def gcd(x, y): while y: x, y = y, x % y return x def lcm(x, y): return x // gcd(x, y) * y C = lcm(A, B) res = -(-T // A) - (-T // B) + (-T // C) print(res)