N, K = map(int, input().split()) MAX = N * (N + 1) // 2 MIN = (N - K + 1) * (N - K) - MAX print((MAX - MIN) // 2 + 1)