//С++
#include <iostream>
using namespace std;
signed main() {
int n, pr = 1;
cin >> n;
for (int i = 1; i <= n; i++)
if (i % 7 == 0)
pr *= i;
cout << pr;
return 0;
}
#Python
pr = 1
n = int(input())
for i in range(1,n+1):
if i % 7 == 0:
pr *= i
print(pr)
//С++
#include <iostream>
using namespace std;
signed main() {
int n, pr = 1;
cin >> n;
for (int i = 1; i <= n; i++)
if (i % 7 == 0)
pr *= i;
cout << pr;
return 0;
}
#Python
pr = 1
n = int(input())
for i in range(1,n+1):
if i % 7 == 0:
pr *= i
print(pr)