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