#include using namespace std; int main(){ unsigned long N, K; cin >> N >> K; cout << K * (2 * N - K + 1) / 2 + 1 << endl; }