#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); ll N, K, M; cin >> N >> K; M = N - K; cout << 1LL + N * (N + 1) / 2LL - M * (M + 1) / 2LL << endl; return 0; }