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