import java.util.*;
public class Main{
  
  public static void main(String[] args){
    
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count=0;
    for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    }
    System.out.println(count);
    
  }
  
} import java.util.*; util.* java public class Main{
  
  public static void main(String[] args){
    
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count=0;
    for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    }
    System.out.println(count);
    
  }
  
} Main public static void main(String[] args){
    
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count=0;
    for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    }
    System.out.println(count);
    
  } main {
    
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count=0;
    for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    }
    System.out.println(count);
    
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int count=0; count 0 for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    } {
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    } String x = Integer.toString(i); x Integer.toString(i) Integer.toString Integer i int length = x.length(); length x.length() x.length x if(length%2!=0){
        count++;
      } length%2!=0 length%2 length 2 0 {
        count++;
      } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
  
  public static void main(String[] args){
    
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count=0;
    for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    }
    System.out.println(count);
    
  }
  
} public class Main{
  
  public static void main(String[] args){
    
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count=0;
    for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    }
    System.out.println(count);
    
  }
  
} Main
import java.util.*;
public class Main{
  
  public static void main(String[] args){
    
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count=0;
    for(int i=1;i<=N;i++){
      String x = Integer.toString(i);
      int length = x.length();
      if(length%2!=0){
        count++;
      }
    }
    System.out.println(count);
    
  }
  
}