#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; //typedef pair P; ll MOD = 1000000007; const int mod = 1000000007; ll INF = 1LL << 60; template void Fill(A (&array)[N], const T &val) { fill((T *)array, (T *)(array + N), val); } int main() { ios::sync_with_stdio(false); cin.tie(0); ll n , k; cin >> n >> k; cout <<(k*(2*n-k+1))/2 +1<< endl; }