#include<bits/stdc++.h>
using namespace std;
unsigned long long a[100001];
unsigned long long c[100001];
int main()
{
int n;
cin >> n;
for(int i = 1;i <= 999;i++)
a[i] = 0;
a[1] = 1;
int b = 1;
int f = 1;
for(int i = 1 ;i <= n;i++)
{
f = 1;
int x = 0;
for(int j = 1 ;j <= b;j++)
{
a[j] = a[j] * i + x;
x = a[j] / 10;
a[j] = a[j] % 10;
}
while(x > 0)
{
b++;
a[b] += x;
x = a[b]/10;
a[b] %= 10;
}
for(int j = 1 ;j <= b;j++)
{
c[1] += a[j] * pow(10 , j - 1);
}
x = c[1] / 10;
c[1] %= 10;
while(x > 0)
{
++f;
c[f] += x;
x = c[f] / 10;
c[f] %= 10;
}
}
for(int i = f ;i >= 1;i--)
cout << c[i];
return 0;
}