#include <bits/stdc++.h>
using namespace std;
string high_precision_multiplication(const char *a_1,const char *b_1){
vector<int> a;
vector<int> b;
vector<int> c;
int lena = strlen(a_1),lenb = strlen(b_1);
for (int i = 0;i < lena;i++){
a.push_back(a_1[lena - i - 1] - '0');
}
for (int i = 0;i < lenb;i++){
b.push_back(b_1[lenb - i - 1] - '0');
}
for (int i = 0;i < lena;i++){
int t1 = 0;
for (int j = 0;j < lenb;j++){
int index = i + j;
if (index >= c.size()) {
c.push_back(0);
}
int temp = c[index] + a[i] * b[j];
t1 = temp / 10;
int t0 = temp % 10;
c[index] = t0;
if (index + 1 < c.size()){
c[index + 1] += t1;
}else{
c.push_back(t1);
}
}
}
int lenc = c.size();
while (lenc - 1 > 0 && c[lenc - 1] == 0){
lenc--;
}
static char result[105];
for (int i = 0; i < lenc; i++) {
result[lenc - i - 1] = c[i] + '0';
}
result[lenc] = '\0';
return result;
}
string high_precision_addition(const char *a_1,const char *b_1){
vector<int> a;
vector<int> b;
vector<int> c;
int lena = strlen(a_1),lenb = strlen(b_1);
for (int i = 0;i < lena;i++){
a.push_back(a_1[lena - i - 1] - '0');
}
for (int i = 0;i < lenb;i++){
b.push_back(b_1[lenb - i - 1] - '0');
}
int lenc = max(lena,lenb);
int temp = 0,t1 = 0,t0 = 0;
for (int i = 0;i < lenc;i++){
if (i >= a.size()){
a.push_back(0);
}
if (i >= b.size()){
b.push_back(0);
}
if (i >= c.size()){
c.push_back(0);
}
temp = a[i] + b[i] + c[i];
t1 = temp / 10;
t0 = temp % 10;
c[i] = t0;
if (i + 1 < c.size()){
c[i + 1] = t1;
}else{
c.push_back(t1);
}
}
if (c[lenc] != 0){
lenc++;
}
static char result[105];
for (int i = 0; i < lenc; i++) {
result[lenc - i - 1] = c[i] + '0';
}
result[lenc] = '\0';
return result;
}
int main(){
int n;
cin >> n;
string temp = "1";
string sum = "0";
for (int i = 1;i <= n;i++){
string t = to_string(i);
temp = high_precision_multiplication(temp.c_str(),t.c_str());
sum = high_precision_addition(sum.c_str(),temp.c_str());
}
cout << sum;
return 0;
}