public class Fact {
  public static int ff(int n) {
    int fact = 1;
    for (int i = 1; i <= n; i++) {
      fact *= i;
    }
    return fact;
  }

  public static int wf(int n) {
    int fact = 1;
    while (n > 1) {
      fact *= n--; // Does this change the 'n' actual parameter?
    }
    return fact;
  }

  public static int rf(int n) {
    if (n > 1)
      return n * rf(n - 1);
    else
      return 1;
  }

  // 5.1) How to read from the input?
  public static void main(String args[]) {
    int n = Integer.parseInt(args[0]);
    System.out.println(rf(n));
  }
}
