from math import lcm N, A, B = map(int, input().split()) ans = N - N//A - N//B + N//lcm(A, B) print(ans)