N, K = map(int, input().split()) mx = (N * (N + 1)) // 2 mi = ((N - K) * (N - K + 1)) - mx diff = mx - mi ans = diff // 2 + 1 print(ans)