#include<stdio.h>
#include <string>
#include <iostream>
#include <vector>
#include <sstream>
#include<math.h>
#include <algorithm>
using namespace std;


int factorial_recursive(int n);
int factorial_loop(int n);

int main(void)
{
  int n;
   int result1, result2;


cin>>n;
if(0<n&&n<21) ;
else return 0;
	result1 = factorial_recursive(n);
    result2 = factorial_loop(n);

	cout<<result1<<endl;

}
int factorial_recursive(int n) {
		if (n > 0) {
        return factorial_recursive(n - 1) * n;
    } else {
        return 1;
    }
}

/**
 * 階乗を計算する(ループ)
 * @param[in] n 整数 
 * @return 階乗
 */
int factorial_loop(int n) {
    int result = 1;
    int k;

    for(k = 1; k <= n; k++) {
        result *= k;
    }
    return result;
}