include<stdio.h>

main()
{int n,i,j,k,sum=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{k=1;
for(j=i;j!=0;j--)
{k*=j;}
sum+=k;}
printf("%d",sum);}