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