import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main
(String[] args
) { Scanner sc
= new Scanner
(System.
in); int n =sc.nextInt();
int ans=1;
int tmpEven=1;
int tmpOdd=1;
int count=0;
boolean even=false, odd=false;
for (int i = n; i > 0; i--) {
if(count==3){
break;
}
ans=ans*i;
count++;
} else if(i%2 ==0 && !even){
ans=ans*i;
tmpEven=i-2;
even =true;
count++;
} else if(i%2 !=0 && !odd) {
ans=ans*i;
tmpOdd=i-2;
count++;
odd=true;
}
}
if(count != 3){
if(n%2 == 0){
ans=ans*tmpEven;
}else{
ans=ans*tmpOdd;
}
}
}
}
aW1wb3J0IGphdmEubWF0aC5CaWdJbnRlZ2VyOwppbXBvcnQgamF2YS51dGlsLlNjYW5uZXI7CgpwdWJsaWMgY2xhc3MgTWFpbiB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CgkJU2Nhbm5lciBzYyA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJaW50IG4gPXNjLm5leHRJbnQoKTsKCQlpbnQgYW5zPTE7CgkJaW50IHRtcEV2ZW49MTsKCQlpbnQgdG1wT2RkPTE7CgkJaW50IGNvdW50PTA7CgkJYm9vbGVhbiBldmVuPWZhbHNlLCBvZGQ9ZmFsc2U7CgkJZm9yIChpbnQgaSA9IG47IGkgPiAwOyBpLS0pIHsKCQkJaWYoY291bnQ9PTMpewoJCQkJYnJlYWs7CgkJCX0KCQkJaWYoQmlnSW50ZWdlci52YWx1ZU9mKGkpLmlzUHJvYmFibGVQcmltZSgxKSl7CgkJCQlhbnM9YW5zKmk7CgkJCQljb3VudCsrOwoJCQl9IGVsc2UgaWYoaSUyID09MCAmJiAhZXZlbil7CgkJCQlhbnM9YW5zKmk7CgkJCQl0bXBFdmVuPWktMjsKCQkJCWV2ZW4gPXRydWU7CgkJCQljb3VudCsrOwoJCQl9IGVsc2UgaWYoaSUyICE9MCAmJiAhb2RkKSB7CgkJCQlh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