// C
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
	int n;
	cin >> n;

	vector<char> p(n + 1, 1); p[0] = p[1] = 0;
	for (long long i = 2; i * i < n + 1; i += 1 + (i & 1))
		if (p[i]) for (long long j = i * i; j < n + 1; j += i) p[j] = 0;

	vector<int> ans(n);
	ans[0] = 1;
	map<int, set<int>> s;
	for (int i = 1; i < n; i++) {
		if (p[i + 1]) {
			ans[i] = 2;
			for (int j = (i + 1) * 2; j <= n; j += i + 1) s[j].insert(2);
		}
	}

	for (int i = 0; i < n; i++) {
		if (ans[i]) continue;
		int c = 3;
		for ( ; s[i + 1].count(c) ; c++) {}
		ans[i] = c;
		for (int j = (i + 1) * 2; j <= n; j += i + 1) s[j].insert(c);
		s.erase(i + 1);
	}

	for (int i = 0; i < n; i++) cout << (i ? " " : "") << ans[i];
	cout << endl;

	return 0;
}

#include <iostream>

int main()
{
    unsigned long long N;
    std::cin >> N;
    unsigned long long ans = 0;
    unsigned long long t = 1;
    for (auto i = 0ull; i < 5; ++i)
    {
        t *= 1000;
        if (N >= t)
        {
            ans += N;
            ans -= (t - 1);
        }
    }
    std::cout << ans << std::endl;
    return 0;
}
