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