import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n=scn.nextInt(),tot=1;
for(int i=1;i<n;i++)
tot*=i;
if(n<0)
tot=0;
System.out.println(tot);
}
/*
題目:[C_MM247-易] 環狀排列
作者:1010
時間:西元 2016 年 8 月 */
}