#include using lint = long long; constexpr lint MOD = 1e12; void solve() { lint n; std::cin >> n; lint ans = 1; for (lint i = 1; i <= n; ++i) { (ans *= i) %= MOD; if (ans == 0) break; } std::cout << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }