program main
    implicit none
    integer n,k,i,p,q
    read(*,*) n,k
    p=0
    q=0
    do i=0,k-1
        p=p+i
    end do
    do i=0,n
        q=q+i
    end do
    write(*,*) q-p+1
end program main
