import sys input=lambda: sys.stdin.readline().rstrip() n,k=map(int,input().split()) print((n+n-k+1)*k//2+1)