#include <bits/stdc++.h> using namespace std;
int main() { int n, s, j; cin >> n; j = 0; s = 1; for (int i = 1 ; i <= n ; i++) { s *= i; j += s; } cout << j << endl; return 0; }