from math import gcd def lcm(a, b): return a * b // gcd(a, b) T, A, B = map(int, input().split()) ans1 = T // A + 1 + (-1 if T % A == 0 else 0) ans2 = T // B + 1 + (-1 if T % B == 0 else 0) L = lcm(A, B) ans3 = T // L + 1 + (-1 if T % L == 0 else 0) print(ans1 + ans2 - ans3)