#include<stdio.h> int main() { long n,b=1,a=1,s=0; scanf("%ld",n); while(b<=n) { a*=b; b++; s+=a; } printf("%ld",s); return 0; }