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