#includedouble fac(int n){double f=1; for(;n;)f*=n--; return f;}int main(){int i,n; double s=0; scanf("%d",&n); for(i=1;i<=n;i++) s+=fac(i); printf("%.0lf\n",s); return 0;}