import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int total = 0;
    total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909;
    System.out.println(total);    
  } 
} 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 total = 0;
    total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909;
    System.out.println(total);    
  } 
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int total = 0;
    total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909;
    System.out.println(total);    
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int total = 0;
    total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909;
    System.out.println(total);    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int total = 0; total 0 total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909 total n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909 n<10 n 10 n n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909 n<100 n 100 9 n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909 n<1000 n 1000 n-90 n 90 n<10000 ? 909:n<100000 ? n-9090:90909 n<10000 n 10000 909 n<100000 ? n-9090:90909 n<100000 n 100000 n-9090 n 9090 90909 System.out.println(total) System.out.println System.out System System.out total String args[] args public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int total = 0;
    total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909;
    System.out.println(total);    
  } 
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int total = 0;
    total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909;
    System.out.println(total);    
  } 
} Main
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int total = 0;
    total = n<10 ? n:n<100 ? 9:n<1000 ? n-90:n<10000 ? 909:n<100000 ? n-9090:90909;
    System.out.println(total);    
  } 
}