#include<iostream> #include<algorithm> std::string MultiLongInt(const std::string& s1, const std::string& s2) { std::string result(s1.size() + s2.size(), '0'); for (int i = s1.size() - 1; i >= 0; i--) { int carry = 0; for (int j = s2.size() - 1; j >= 0; j--) { int mul = (s1[i] - '0') * (s2[j] - '0') + (result[i + j + 1] - '0') + carry; carry = mul / 10; result[i + j + 1] = mul % 10 + '0'; } result[i] += carry; } size_t startpos = result.find_first_not_of("0"); if(startpos == std::string::npos) return "0"; return result.substr(startpos); } int main() { int n; std::string sum; while (std::cin >> n) { sum = '1'; for(int i=2;i<=n;i++) { sum = MultiLongInt(sum, std::to_string(i)); } std::cout << sum << std::endl; } }