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