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