#include using namespace std; typedef long long ll; typedef pair pii; #define pb push_back #define mp make_pair #define rep(i,n) for(int i=0;i<(n);++i) const int mod=1000000007; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n,k;cin >> n >> k; if(n==1){ cout << 2 << endl; return 0; } ll ans=n*(n+1)/2-(n-k)*(n-k+1)/2; cout << ans+1 << endl; }