import math
def lcm(a, b):
    return a * b // math.gcd(a, b)
t, a, b = map(int, input().split())
t -= 1
print(t // a + t // b - t // lcm(a, b) + 1)