Sasha is a very happy guy, that's why he is always on the move. There are $n$ cities in the country where Sasha lives. They are all located on one straight line, and for convenience, they are numbered from $1$ to $n$ in increasing order. The distance between any two adjacent cities is equal to $1$ kilometer. Since all roads in the country are directed, it's possible to reach the city $y$ from the city $x$ only if $x < y$. 

Once Sasha decided to go on a trip around the country and to visit all $n$ cities. He will move with the help of his car, Cheetah-2677. The tank capacity of this model is $v$ liters, and it spends exactly $1$ liter of fuel for $1$ kilometer of the way. At the beginning of the journey, the tank is empty. Sasha is located in the city with the number $1$ and wants to get to the city with the number $n$. There is a gas station in each city. In the $i$-th city, the price of $1$ liter of fuel is $i$ dollars. It is obvious that at any moment of time, the tank can contain at most $v$ liters of fuel.

Sasha doesn't like to waste money, that's why he wants to know what is the minimum amount of money is needed to finish the trip if he can buy fuel in any city he wants. Help him to figure it out!


-----Input-----

The first line contains two integers $n$ and $v$ ($2 \le n \le 100$, $1 \le v \le 100$)  — the number of cities in the country and the capacity of the tank.


-----Output-----

Print one integer — the minimum amount of money that is needed to finish the trip.


-----Examples-----
Input
4 2

Output
4

Input
7 6

Output
6



-----Note-----

In the first example, Sasha can buy $2$ liters for $2$ dollars ($1$ dollar per liter) in the first city, drive to the second city, spend $1$ liter of fuel on it, then buy $1$ liter for $2$ dollars in the second city and then drive to the $4$-th city. Therefore, the answer is $1+1+2=4$.

In the second example, the capacity of the tank allows to fill the tank completely in the first city, and drive to the last city without stops in other cities.

Difficulty: interview

Starter code:

Solutions:
n,v = map(int,input().split())
req = n-1

if req<=v:
    print (req)
else:
    total = v
    remaining = req-v
    for x in range(remaining):
        total += 2+x
    print (total)

n, v = map(int, input().split())
cur = 0
total = 0
for i in range(n):
    while cur < n - i - 1:
        cur += 1
        total += (i + 1)
        if cur == v:
            break
    cur -= 1
print(total)

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

n, v = map(int, input().split())

result = v-1 + (n-v)*(n-v+1)//2 if n-1 > v else n-1
print(result)

n, v = map(int, input().split())
b = 0
ans = 0
sss = 0
for i in range(1, n + 1):
    while b < v:
        if sss == n - 1:
            break
        sss += 1
        ans += i
        b += 1
    b -= 1
print(ans)

n,v = map(int, input().split())
ans = min(v, n-1)
for i in range(n - v - 1):
    ans += i+2
print(ans)

n, v = map(int, input().strip().split())
answer = 0
n -= 1
if n <= v:
    print(n)
else:
    answer =v

    for i in range(1,n-v + 1):

        answer += (i + 1)
    print(answer)

def __starting_point():    
    nums = input().split()
    n = int(nums[0])
    v = int(nums[1])

    if n < v+2:
        print(n - 1)
    else:
        print(int(v-1 + (n-v)*(n-v+1)/2))
__starting_point()

from collections import defaultdict as dd
import math
def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return list(map(int, input().split()))

def lm():
	return list(map(int, input().split()))



n,v=mi()

dist=n-1

if v>=dist:
	print(dist)

else:
	off=dist-v
	prices=[i+2 for i in range(off)]
	print(v+sum(prices))


import copy
import fractions
import itertools
import numbers
import string
import sys

###

def to_basex(num, x):
	while num > 0:
		yield num % x
		num //= x

def from_basex(it, x):
	ret = 0
	p = 1
	for d in it:
		ret += d*p
		p *= x
	return ret

###

def core():
	n, v = [int(x) for x in input().split()]
	
	ans = min(v, n-1)
	
	if n-v > 1:
		ans += (2 + n-v)*(n-v - 2 + 1)//2
	
	print(ans)


core()




















#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    #n=int(input())
    n,v= map(int, sys.stdin.readline().split(' '))
    ans=0
    pe=0

    for i in range(1,n+1):
        dist=n-i
        if(pe<dist):
            ans+=(min(v,dist)-pe)*i
            pe+=(min(v,dist)-pe)
        pe-=1
    print(ans)


    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

def solve(n, v):
    fuel = min(n - 1, v)
    cost = fuel
    for i in range(2, n):
        if fuel >= n - 1:
            break
        fuel += 1
        cost += i
    return cost

n, v = list(map(int, input().split()))
print(solve(n, v))


n, v = list(map(int, input().strip().split()))

remaining_dist = n - 1
adding = min(remaining_dist, v)
cost = adding

remaining_dist -= adding

i = 2
while remaining_dist > 0:
    cost += i
    i += 1
    remaining_dist -= 1

print(cost)


citys,cap=map(int,input().split())
if citys-1<=cap:
	print(citys-1)
else:
	n=citys-cap
	print(n*(n+1)//2+cap-1)

def read_nums():
    return [int(x) for x in input().split()]


def main():
    n, v = read_nums()
    res = 0
    cur_tank = 0
    for c in range(1, n+1):
        need_to_by = min(v - cur_tank, n - c - cur_tank)
        res += need_to_by * c
        cur_tank += need_to_by
        cur_tank -= 1
    print(res)


def __starting_point():
    main()

__starting_point()

a,b=list(map(int,input().split()))
if b>=a-1:
    print(a-1)
else:
    summ=b
    k=a-b
    for i in range(2,k+1):
        summ+=i
    print(summ)


n, v = [int(item) for item in input().split()]

x = 0
c = 0
for i in range(1, n):
    if x < n - i:
        c += i * min((n - i), v - x)
        x += min((n - i), v - x)
    x -= 1

print(c)


n,k=map(int, input().split())
if n-1 <= k:
  print(n-1)
else:
  cnt=k
  ans=k
  i=2
  while(cnt!= n-1):
    ans=ans+i
    cnt+=1
    i+=1
  print(ans)  

n,m=list(map(int,input().split()))
t=m
if m>=n-1:
    print(n-1)
else:
    for i in range(2,n-m+1):
        t=t+i
    print(t)


# Bismillahirahmanirahim
# Soru 1

nv = list(map(int, input().split()))

n = nv[0] - 1
v = nv[1]
if v >= n:
    print(n)
    quit()
k = 2
money = v
while n - v > 0:
    n = n - 1
    money += k
    k += 1
print(money)

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
"""

from operator import itemgetter

n, v = list(map(int, input().split()))

if v >= n-1:
    ans = n-1
else:
    ans = v + ((2+(2+n-v-2))*(n-v-1))//2
print(ans)


n, v = input().split()
n = int(n)
v = int(v)

if (n <= v):
    print(n-1)
else:
    summ = v
    for i in range(n-v-1):
        summ += i+2
    print(summ)


# import math
# import sys

n,v = [int(x) for x in input().strip().split(" ")]
if v>=(n-1):
	print(n-1)
else:
	print(n-1+((n-1-v)*(n-v)//2))


n, m = map(int,input().split())
base = min(n-1,m)
tt = (n-1)-m
i=2
while tt>0:
	base += i
	i += 1
	tt -= 1
print(base)

n,v=map(int,input().split())
m=min(n-1,v)
ans=m
for i in range(2,n+1-m):
  ans+=i
print(ans)