N, K = map( int, input().split()) if K == 0: print(1) else: print(K*(2*N-K+1)//2+1)