import fractions t = input() a = input() b = input() c = a * b // fractions.gcd(a, b) print((t + a - 1) // a + (t + b - 1) // b - (t + c - 1) // c)