#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;
}
#include<stdio.h>
int fac(int f)
{ int m; if(f==0||f==1) m=1; else m=f*fac(f-1); return m; }
int main(void)
{ int n,i,m; int sum=0; puts("1!+2!+3!+4!+...+n!=?"); puts("Please input the n you want it to work:"); scanf("%d",&n); for(i=1;i<=n;i++) sum=sum+fac(i); printf("The sum of njie is %d",sum); return 0; }