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