N, A, B = map(int, input().split()) ans = 0 for n in range(1, N+1): ans += n%A > n%B print(ans)