INF = 10 ** 9 MOD = 10 ** 9 + 7 import sys sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from copy import deepcopy from bisect import bisect_left def main(): n,k = map(int,input().split()) M = n * (n + 1)//2 m = - M + (n - k) * (n - k + 1) print((M - m)//2 + 1) if __name__ == '__main__': main()