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

vector<int> ans;

int calc(int n, vector<int> num)
{
  //int ans;
  //int min;
  vector<int> div;
  
  for(int a = 1; a <= (int)sqrt(n); a++)
  {
    if(n % a == 0)
    {
      if(a * a == n) div.push_back(num.at(a - 1));
      else
      {
        div.push_back(num.at(a - 1));
        if(a != 1) div.push_back(num.at(n / a - 1));
      }
    }
  }
  
  sort(div.begin(), div.end());
  
  return div.at(div.size() - 1) + 1;
}

int main()
{
  int N;
  cin >> N;
  
  int next;
  if(N == 1) cout << 1 << endl;
  else
  {
    ans.push_back(1);
    for(int i = 2; i <= N; i++)
    {
      next = calc(i, ans);
      ans.push_back(next);
    }
    for(int i = 0; i < N; i++)
    {
      cout << ans.at(i) << ' ';
    }
    cout << endl;
  }
}
#include <stdio.h>
#include <iostream>
#include <cmath>

using namespace std;


int get_num_digits(long long x){
    int c = 0;
    do {
        x = x / 10;
        c++;
    }
    while (x > 0);
    return c;
}


int main(){
    long long N;
    cin >> N;

    int x_half = 1;
    int count = 0;
    
    while (true){
        int n_digits = get_num_digits(x_half);
        long long x = pow(10, n_digits) * x_half + x_half;
        
        if (x > N){
            break;
        }
        x_half++;
        count++;
    }
    
    cout << count << endl;
}