#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll sum=0,n;
ll _jiecheng(int x)
{
ll ans=1;
for(int i=1;i<=x;++i)
{
ans*=i;
}
return ans;
}
int main()
{
cin>>n;
for(int i=1;i<=n;++i)
{
ll cnt= _jiecheng(i);
sum+=cnt;
}
cout<<sum;
return 0;
}