//AC
#include <iostream>
#include <cstdlib>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
typedef long long ll;
using namespace std;
int main(){
int n;
int sum,re;
while(scanf("%d",&n)!=EOF){
re=0;
for (int i=1; i<=n; i++) {
sum=1;
for (int j=1; j<=i; j++) {
sum=sum*j;
}
re=re+sum;
}
printf("%d\n",re);
}
return 0;
}