import java.io.*;

public class factorialrecursivo {

static double factorial(int n)
{
if (n==0)
return 1;// Caso base
else
return n*factorial(n-1);// Caso general

}

public static void main(String ars[])
{
double f=1;
try{

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.println("Ingresa un numero:");
String n1 = br.readLine();

int s = Integer.parseInt(n1);

System.out.println(factorial(s));

}
catch(Exception e){

System.out.println("Error en los datos");

}

}

}