#include using namespace std; long long gcd(long long x, long long y) { if (y == 0) return x; return gcd(y, x % y); } long long lcm(long long x, long long y) { if (x == 0 || y == 0) return 0; return x / gcd(x, y) * y; } int main() { long mod = 10000000000000; int N; cin >> N; long x = 1; for (long i = 2; i <= N; i++) { x = (x * i) % mod; } string ans = to_string(x); if (ans.size() <= 12) cout << ans << endl; else cout << ans.substr(1, ans.size() - 1) << endl; }