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