#include<stdio.h>
int main()
{
int N;
scanf("%d", &N);
int sum = 0;
for (int i = 1; i <= N; i++) {
int a = 1;
for (int j = 1; j <= i; j++) {
a = a * j;
}
sum = sum + a;
}
printf("%d", sum);
}
#include<stdio.h>
int main()
{
int n,i,a,b,c;
scanf("%d",&n);
i=3;
a=0,b=1;
if(n<=2){
if(n==1){
printf("%d",a);
}else{
printf("%d",b);
}
}else{
while(i<=n){
c=a+b;
a=b;
b=c;
i++;
}
printf("%d",c);
}
}