#include<bits/stdc++.h>
using namespace std;
`
bool sushu(int n)
{
if (n < 2) return 0;
for (int i = 2; i * i <= n; i++)
{
if (n % i == 0)
return 0;
return 1;
}
}
int main()
{
int s;
cin >> s;
for (int i = s / 2; i >= 2; i--)
if (sushu(i))
{
int j = s - i;
if (sushu(j))
{
cout << i * j;
return 0;
}
}
return 0;
}