#include <iostream>
using namespace std;
int main(){
  long long n;
  cin >> n;
  long long left = 0, right = 2000000010;
  while(right - left > 1){
    long long mid = (left + right) / 2;
    if(mid * (mid + 1) / 2 <= n + 1){
      left = mid;
    }else{
      right = mid;
    }
  }
  cout << n - left + 1 << endl;
  return 0;
}
#include<iostream>
#include<vector>
using namespace std;
#define pii pair<int,int>
int spf[100002];  // smallest prime factor
int n=100001;
int num[100001];
void sieve(){  //埃氏篩法 預處理 O(nloglogn)
    spf[1]=1;
    for (int i=2;i<=n;i++ ) spf[i]=i;
    for (int i=4; i<n; i+=2) spf[i] = 2; 
    for (int i=3;i*i<=n;i++){  // (i is prime) 只需要找到 小於等於 sqrt(n) 的質數
        if (spf[i]==i) { // if i is prime
            for (int j=i*i;j<=n;j+=i){  // j 可以從i^2 開始，因為  i*k (k<i) 都已經被mark過了 
                if(spf[j]==j) spf[j]=i;
            }
        }
    }
}
vector<int> prfc(int x){
    //set<pii> ans;
    //vector<int> now;
    vector<int> ans;
    int y=x;
    while(y!=1){
        int pr=spf[y];
        //auto it=find(now.begin(),now.end(),pr);
        //if (if!=now.end()){

        //}
        ans.push_back(pr);
        y/=pr;
    }
    return ans;
}
int main(){
    int k;cin>>k;
    sieve();
    num[1]=1;
    int maxn=0;
    for (int i=2;i<=k;i++) if (spf[i]==i) num[i]=2;
    for (int i=4;i<=k;i++){
        num[i]=num[i/spf[i]]+1;
        if (num[i]>maxn) maxn=num[i];

    }
    for (int i=1;i<=k;i++) cout<<num[i]<<" ";
    //cout<<maxn<<endl;
}