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