import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ct = 0;
    int digit;
    for (int i=1;i<=N;i++){
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    }
    
    
    System.out.println(ct);
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ct = 0;
    int digit;
    for (int i=1;i<=N;i++){
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    }
    
    
    System.out.println(ct);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ct = 0;
    int digit;
    for (int i=1;i<=N;i++){
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    }
    
    
    System.out.println(ct);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ct = 0;
    int digit;
    for (int i=1;i<=N;i++){
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    }
    
    
    System.out.println(ct);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ct = 0; ct 0 int digit; digit for (int i=1;i<=N;i++){
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    } {
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    } digit = 0 digit 0 double tmp = i; tmp i while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      } tmp>=1 tmp 1 {
        tmp = Math.floor(tmp/10);
        digit++;
      } tmp = Math.floor(tmp/10) tmp Math.floor(tmp/10) Math.floor Math tmp/10 tmp 10 digit++ digit if ((digit%2) == 1){
        ct++;
      } (digit%2) == 1 (digit%2) digit 2 1 {
        ct++;
      } ct++ ct System.out.println(ct) System.out.println System.out System System.out ct String[] args args
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ct = 0;
    int digit;
    for (int i=1;i<=N;i++){
      digit = 0;
      double tmp = i;
      while (tmp>=1){
        tmp = Math.floor(tmp/10);
        digit++;
      }
      if ((digit%2) == 1){
        ct++;
      }
    }
    
    
    System.out.println(ct);
  }
}