import java.io.*;

public class Factorial
{

  public static void main(String argv[]) throws IOException
  {
    int n;          // number whose factorial is computed
    int Factorial;   // variable in which n! is computed
    int i=0;        // counter variable, initially 0

    System.out.println("Enter an integer:");
    n = Integer.parseInt( new DataInputStream(System.in).readLine() );

   if (n < 0)
    System.out.println("You entered a number less than 0.");
   else
    {
    Factorial = i = n;

    while ( i > 1 )
        Factorial *= i--;

    System.out.println(n + "! = " + Factorial);
    }
  }
}