#include<iostream>
#include <iomanip>
using namespace std;

//double datatype is used here so that more large numbers can be dealt with

double factorial(double x) {
	double r;
	if (x == 0 || x == 1) {
		r = 1;
	} else {
		r = x * factorial(x-1);
	}
	return r;
}

int main() {
	int n;
	cout << "n = ";
	cin >> n;
	if (n<0) {
		cout << "Error: n has to be a positive integer or zero!";
	} else {
		cout << n << "! = " << fixed << setprecision(0) << factorial(n);
	}
	return 0;
}
