#include<iostream>
using namespace std;
int main() {int k;cin >> k;int sum = 0;int n = 1;while (k > 0) {sum += n * n;k -= n;n++;}sum += k * (n - 1);cout << sum << endl;return 0;
}
#include<iostream>
using namespace std;
int main() {int k;cin >> k;int sum = 0;int n = 1;while (k > 0) {sum += n * n;k -= n;n++;}sum += k * (n - 1);cout << sum << endl;return 0;
}