import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,K = map(int,read().split()) x = (N + (N-K+1)) * K // 2 answer = x + 1 print(answer)