#include <bits/stdc++.h>
const int maxn=100000;
using namespace std;
int a[1000000]={0,1,2,2,3};
int isprime[maxn+100];
int prime[maxn+100];
int num=0;
void init(){
    for(int i=0;i<=maxn;i++)isprime[i]=1;
    isprime[1]=0;
    for(int i=2;i<=maxn;i++){
        if(isprime[i]==1){
            prime[num++]=i;
            a[i]=2;
        }
        for(int j=0;j<num&&i*prime[j]<=maxn;j++){
            isprime[i*prime[j]]=0;
            a[i*prime[j]]=max(a[i],a[prime[j]])+1;
            if(i%prime[j]==0)break;
        }
    }
}
int main()
{
    //cout << "Hello world!" << endl;
    init();
    int N;
    cin>>N;

    for(int i=1;i<=N;i++){
        printf("%d ",a[i]);
    }
    return 0;
}

#include <bits/stdc++.h> 
using namespace std;
#define int long long
#define endl '\n'
#define pb push_back
#define mod 1000000007
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define PI 3.1415926535
#define INF INT_MAX
#define SPEED                       \
  ios_base::sync_with_stdio(false); \
  cin.tie(0);                       \
  cout.tie(0);
  
// Aakash

void solve(){
  int n;
  cin>>n;
  
  int sum=0;
  if(n<1000)
  sum=0;
  else if(n<1e6)
  sum =  (1*(n - 1e3 +1 ));
  else if(n<1e9)
  sum =  (1*(1e6-1e3) + 2*(n- 1e6 +1));
  else if(n<1e12)
  sum =  (1*(1e6-1e3) + 2*(1e9 - 1e6 ) + 3*(n- 1e9 +1));
  else if(n<1e15)
  sum =  (1*(1e6-1e3) + 2*(1e9 - 1e6 ) + 3*(1e12 - 1e9 ) + 4*(n- 1e12 +1));
  else if(n==1e15)
  sum =  (1*(1e6-1e3) + 2*(1e9 - 1e6 ) + 3*(1e12 - 1e9 ) + 4*(1e15- 1e12 ) + 5);

  cout<<sum<<endl;

}

int32_t main() { 

  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);

     SPEED;
     int t=1;
    //  cin>>t;
     while(t--){
              solve();
     }
    return 0; 
} 


