structf { int len, s[10000]; f() { memset(s, 0, sizeof(s)); len = 1; } f operator = (constchar *num) { len = (int)strlen(num); for(int i = 0; i < len; i++) s[i] = num[len - i - 1] - '0'; return *this; } f operator = (constint num) { char a[10000]; sprintf(a, "%d", num); *this = a; return *this; } f (constint num) { *this = num; } f (constchar *num) { *this = num; } f operator + (const f &a) { f c; c.len = max(len, a.len) + 1; for(int i = 0, x = 0; i < c.len; i++) { c.s[i] = s[i] + a.s[i] + x; x = c.s[i] / 10; c.s[i] = c.s[i] % 10; } if(c.s[c.len - 1] == 0) --c.len; return c; } f operator * (const f &x) { f c; c.len = len + x.len; for(int i = 0; i < len; i++) { for(int j = 0; j < x.len; j++) { c.s[i + j] += s[i] * x.s[j]; c.s[i + j + 1] += c.s[i + j] / 10; c.s[i + j] %= 10; } } if(c.s[c.len - 1] == 0) --c.len; return c; } }; ostream& operator << (ostream &out, const f &x) { for(int i = x.len - 1; i >= 0; i--) out << x.s[i]; return out; } istream& operator >> (istream &in, f &x) { char num[10000]; in >> num; x = num; return in; }
intmain(int argc, constchar *argv[]) { int n; cin >> n; f ans = 0, num = 1; for(int i = 1; i <= n; i++) { num = num * i; ans = ans + num; } cout << ans << endl; return0; }