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