typedef long long ll; #include using namespace std; int main() { ll n,k; std::cin >> n>>k; ll sum = 1; for (int i = 1; i <= k; i++) { sum += n-(i-1); } std::cout << sum << std::endl; }