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