#include<iostream> using namespace std; int main() { int i, n, p = 1; cin >> n; long int s = 0; for(i = 1; i <= n; i++) { p *= i; s += p; } cout << s; return 0; }