import math
def inp():
    return int(raw_input())
def linp():
    return map(int, raw_input().split())
n, x = map(int, raw_input().split())
ans = n
temp = x
inc = 2
p = 2*x
while(temp>0):
    ans+=(inc*temp)
    temp = n-p
    inc+=1
    p+=2*x
print ans
