#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define int ll
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb emplace_back
#define pii pair<int , int>
#define F first
#define S second
const int mod = 1000000007;
const int MAXX = 1e5 + 5;

const int N = 1e5;

int t , n , m;
int a[MAXX];

signed main()
{
    _FastIO;
    cin >> n;
    a[1] = 1;
    for(int i = 2; i <= n; i++){
        int cnt = 1;
        for(int j = 1; (j * j) <= i; j++){
            if(i % j == 0){
                cnt = max(cnt , a[j]);
                cnt = max(cnt , a[i / j]);
            }
        }
        a[i] = cnt + 1;
    }
    for(int i = 1; i <= n; i++){
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}

#include<bits/stdc++.h>

#define int long long
int n,now,ans;
using namespace std;

signed main()
{
	scanf("%lld",&n);
	int p=sqrt((n+1)*2);
	while(p*(p+1)/2<=n+1)
	{
		p++;
	}
	p--;
	//cout<<p<<endl;
	//if(p*p==n*2) p--;
	//cout<<p<<endl;
	printf("%lld\n",n-p+1);
	return 0;
}