n, k = map(int, input().split()) ans = k * (n + n - k + 1) // 2 print(ans + 1)