program Factorial{

    function f(Integer n):Integer;
    {
        return n > 1 ? n * f(n - 1) : 1;
    }

    function Main():void;
    var
    {
        Integer n;
    }
    {
		writeLn("Input n:");
        n = nextInteger();
        writeLn("!" + n + " = " + f(n));
		getKey();
    }
}