import java.io.*;
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    
    double log = 0;
    int sum = 0;
    for (int i = 1; i <= N; i++) {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    }
    
    System.out.println(sum);
  }
} import java.io.*; io.* java import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    
    double log = 0;
    int sum = 0;
    for (int i = 1; i <= N; i++) {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    }
    
    System.out.println(sum);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    
    double log = 0;
    int sum = 0;
    for (int i = 1; i <= N; i++) {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    }
    
    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    
    double log = 0;
    int sum = 0;
    for (int i = 1; i <= N; i++) {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    }
    
    System.out.println(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double log = 0; log 0 int sum = 0; sum 0 for (int i = 1; i <= N; i++) {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    } {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    } log = Math.log10(i) log Math.log10(i) Math.log10 Math i if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      } log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0 log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0 log < 1.0 log 1.0 2.0 <= log && log < 3.0 2.0 <= log 2.0 log log < 3.0 log 3.0 4.0 <= log && log < 5.0 4.0 <= log 4.0 log log < 5.0 log 5.0 {
        sum ++;
      } sum ++ sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.io.*;
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    
    double log = 0;
    int sum = 0;
    for (int i = 1; i <= N; i++) {
      log = Math.log10(i);
      if (
        log < 1.0 || 
        2.0 <= log && log < 3.0 ||
        4.0 <= log && log < 5.0
      ) {
        sum ++;
      }
    }
    
    System.out.println(sum);
  }
}