#include <iostream>
#include <cstdio>
#include <iterator>
#include <string>
#include <cstring>
using namespace std;
const int maxn = 10000;
struct biginteger {
int digit[maxn];
int length;
biginteger(); //构造
biginteger(int x); //带参构造
biginteger operator=(string str); //赋值
biginteger operator+(const biginteger& b); //相加
biginteger operator*(const biginteger& b);
friend istream& operator>>(istream& in, biginteger& x); //输入
friend ostream& operator<<(ostream& out,const biginteger& x); //输出
};
istream& operator>>(istream& in, biginteger& x) {
string str;
in >> str;
x = str;
return in;
}
ostream& operator<<(ostream& out, const biginteger& x) {
for (int i = x.length - 1; i >= 0; i--) {//倒过来存储 要倒过来输出才是正常的十进制
out << x.digit[i];
}
return out;
}
biginteger::biginteger() {
memset(digit, 0, sizeof(digit)); //构造
length = 0;
}
biginteger::biginteger(int x) { //int是倒过来存的 120在数组中是0 2 1
memset(digit, 0, sizeof(digit));
length = 0;
if (x == 0) {
digit[length++] = x;
}
while (x != 0) {
digit[length++] = x % 10;
x /= 10;
}
}
biginteger biginteger::operator=(string str) { //赋值
memset(digit, 0, sizeof(digit));
length = str.size();
for (int i = 0; i < length; i++) {
digit[i] = str[length - i - 1] - '0';
}
return *this;
}
// biginteger biginteger::operator+(const biginteger& b) { //相加
// biginteger answer;
// int carry = 0;
// for (int i = 0; i < length || i < b.length; i++) {
// int current = carry + digit[i] +
// b.digit[i]; //和正常计算一样,先算当前位,再算进位
// carry = current / 10;
// answer.digit[answer.length++] = current % 10; //将当前位存入答案
// }
// if (carry) {
// answer.digit[answer.length++] = carry;
// }
// return answer;
// }
biginteger biginteger::operator*(const biginteger& b) {
biginteger answer;
answer.length = length + b.length;
for (int i = 0; i < length; i++) { //各个位相乘 从0开始 因为是倒过来的 所以0依然是从低位开始
for (int j = 0; j < b.length; j++) {
answer.digit[i + j] += digit[i] * b.digit[j];
}
}
for (int i = 0; i < answer.length; i++) {
answer.digit[i + 1] +=answer.digit[i] / 10;
answer.digit[i] %= 10;
}
while (answer.digit[answer.length-1] == 0 && answer.length > 1) {
answer.length--;
}
return answer;
}
int main() {
int n;
while (scanf("%d", &n) != EOF) {
biginteger answer(1);
for (int i = 1; i <= n; i++) {
answer = answer * biginteger(i);
}
std::cout << answer << std::endl;
}return 0;
}