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