def gcd(a, b):
    """a, bの最大公約数(greatest common divisor:GCD)を求める"""
    if b == 0:
        return a
    return gcd(b, a%b)


def lcm(a, b):
    """a, bの最小公倍数(least common multiple:LCM)を求める"""
    return (a * b) // gcd(a, b)
  

t, a, b = map(int, input().split())

ans = 0
ans += -((-t) // a)
ans += -((-t) // b)
ans -= -((-t)// lcm(a, b))
print(ans)