#include <stdio.h>
double fact(int n);
int main()
{
int i, n;
double item, sum;
while (scanf("%d", &n) != EOF)
{
sum = 0;
if (n <= 12)
{
for (i = 1; i <= n; i++)
{
item = fact(i);
sum = sum + item;
}
}
printf("%.0f\n", sum);
}
return 0;
}
double fact(int n)
{
int i;
double product;
product = 1;
for (i = 1; i <= n; i++)
{
product = product*i;
}
return product;
}