#include<bits/stdc++.h> using namespace std; int main(){ int n,p,a[10000],s; cin>>n>>p; p>=12; n<=500; s=2*p; for(int i=p+1;i<=n;i++)s=s+i; cout<<s; return 0; }