/*----<Bồ tác phù hộ code không bị bug>--------
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \| |// '.
/ \||| : |||// \
/ _||||| -:- |||||- \
| | \ - /// | |
| \_| ''\---/'' |_/ |
\ .-\__ '-' ___/-. /
___'. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' >' "".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `_. \_ __\ /__ _/ .-` / /
=====`-.____`.___ \_____/___.-`___.-'=====
`=---='
------------------<>-------------------------*/
#include <bits/stdc++.h>
#define __Nakano signed
#define Miku__ main()
#define int long long
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fr(x, l, r) for (int x = l; x < r; x++)
#define frr(x, l, r) for (int x = l; x <= r; x++)
#define fd(x, l, r) for (int x = l; x >= r; x--)
#define cs const
#define TIME (1.0*clock() / CLOCKS_PER_SEC)
#define RUNTIME cerr << "\n" << "Runtime: " << TIME << "s\n";
#define Fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define Nakanomiku ios_base::sync_with_stdio(0);
#define TiemNetBaTuyen cin.tie(0);
#define THCSPHAMHUYTHONG cout.tie(0);
typedef double db;
typedef std::string str;
typedef std::vector<int> vi;
typedef std::greater<int> gi;
typedef std::map<int, int> mii;
typedef std::pair<int, int> ii;
inline int gcd(int a,int b){int s;while(b){s=a%b;a=b;b=s;}return a;}
inline int lcm(int a, int b){return a/gcd(a,b)*b;}
cs int N = 1e6 + 5;
cs int oo = 1e18;
using namespace std;
vector<bool> p(N,true);
void sang(){
p[0] = p[1] = false;
for (int i = 4; i <= N; i += 2) p[i] = false;
for (int i = 3; i * i <= N; i += 2){
if (p[i]){
for (int j = i * i; j <= N; j += i * 2) p[j] = false;
}
}
}
__Nakano Miku__ {
Nakanomiku TiemNetBaTuyen THCSPHAMHUYTHONG
int n; cin >> n;
sang();
RUNTIME;
return 0;
}
LyotLS0tPELhu5MgdMOhYyBwaMO5IGjhu5kgY29kZSBraMO0bmcgYuG7iyBidWc+LS0tLS0tLS0KICAgICAgICAgICAgICAgX29vMG9vXyAKICAgICAgICAgICAgICBvODg4ODg4OG8gCiAgICAgICAgICAgICAgODgiIC4gIjg4IAogICAgICAgICAgICAgICh8IC1fLSB8KSAKICAgICAgICAgICAgICAwXCAgPSAgLzAgCiAgICAgICAgICAgIF9fXy9gLS0tJ1xfX18gCiAgICAgICAgICAuJyBcfCAgICAgfC8vICcuIAogICAgICAgICAvIFx8fHwgIDogIHx8fC8vIFwgCiAgICAgICAgLyBffHx8fHwgLTotIHx8fHx8LSBcIAogICAgICAgfCAgIHwgXCAgLSAgLy8vIHwgICB8IAogICAgICAgfCBcX3wgICcnXC0tLS8nJyAgfF8vIHwgCiAgICAgICBcICAuLVxfXyAgJy0nICBfX18vLS4gLyAKICAgICBfX18nLiAuJyAgLy0tLi0tXCAgYC4gLidfX18gCiAgLiIiICc8ICBgLl9fX1xfPHw+Xy9fX18uJyA+JyAiIi4gCiB8IHwgOiAgYC0gXGAuO2BcIF8gL2A7LmAvIC0gYCA6IHwgfCAKIFwgIFwgYF8uICAgXF8gX19cIC9fXyBfLyAgIC4tYCAvICAvIAo9PT09PWAtLl9fX19gLl9fXyBcX19fX18vX19fLi1gX19fLi0nPT09PT0gCiAgICAgICAgICAgICAgIGA9LS0tPScKLS0tLS0tLS0tLS0tLS0tLS0tPD4tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KCiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgoKI2RlZmluZSBfX05ha2FubyAgICAgICAgICBzaWduZWQKI2RlZmluZSBNaWt1X18gICAgICAgICAgICBtYWluKCkKI2RlZmluZSBpbnQgICAgICAgICAgICBsb25nIGxvbmcKI2RlZmluZSBmaSAgICAgICAgICAgICBmaXJzdAojZGVmaW5lIHNlICAgICAgICAgICAgIHNlY29uZAojZGVmaW5lIGFsbCh4KSAgICAgICAgIHguYmVna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