import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = 0;

    for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    }
    System.out.println(a);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = 0;

    for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    }
    System.out.println(a);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = 0;

    for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    }
    System.out.println(a);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = 0;

    for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    }
    System.out.println(a);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a = 0; a 0 for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    } int i=n ; int i=n ; i n i>0 i 0 i-- i-- i {
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    } {
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    } if(String.valueOf(i).length() %2 !=0){
        a++;
      } String.valueOf(i).length() %2 !=0 String.valueOf(i).length() %2 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i 2 0 {
        a++;
      } a++ a System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = 0;

    for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    }
    System.out.println(a);
  }
} public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = 0;

    for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    }
    System.out.println(a);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = 0;

    for(int i=n ; i>0 ; i--){
      if(String.valueOf(i).length() %2 !=0){
        a++;
      }
    }
    System.out.println(a);
  }
}
