#include int factorial(int n){ int res = 1; for (int i = 2; i <= n; i++) res *= i; return res;}int main(){ int n; scanf("%d", &n); int res = 0; for (int i = 1; i <= n; i++) res += factorial(i); printf("%d\n", res); return 0;}