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