import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int m = n;
    
    int d = 1;
    while(m/10!=0){
      d++;
      m = m/10;
    }
    
    int count = 0;
    for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    }
    if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    }
    System.out.println(count);
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int m = n;
    
    int d = 1;
    while(m/10!=0){
      d++;
      m = m/10;
    }
    
    int count = 0;
    for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    }
    if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    }
    System.out.println(count);
  }
} Main public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int m = n;
    
    int d = 1;
    while(m/10!=0){
      d++;
      m = m/10;
    }
    
    int count = 0;
    for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    }
    if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    }
    System.out.println(count);
  } main {
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int m = n;
    
    int d = 1;
    while(m/10!=0){
      d++;
      m = m/10;
    }
    
    int count = 0;
    for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    }
    if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    }
    System.out.println(count);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = n; m n int d = 1; d 1 while(m/10!=0){
      d++;
      m = m/10;
    } m/10!=0 m/10 m 10 0 {
      d++;
      m = m/10;
    } d++ d m = m/10 m m/10 m 10 int count = 0; count 0 for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    } int i = 0; int i = 0; i 0 i < d - 1 i d - 1 d 1 i++ i++ i {
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    } {
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    } if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      } i%2==0 i%2 i 2 0 {
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      } count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i) count (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i) (int)Math.pow(10, (double)(i + 1)) Math.pow Math 10 (double)(i + 1) i 1 (int)Math.pow(10, (double)i) Math.pow Math 10 (double)i if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    } d%2==1 d%2 d 2 1 {
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    } count += n - (int)Math.pow(10, (double)(d - 1)) + 1 count n - (int)Math.pow(10, (double)(d - 1)) + 1 n - (int)Math.pow(10, (double)(d - 1)) n (int)Math.pow(10, (double)(d - 1)) Math.pow Math 10 (double)(d - 1) d 1 1 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 scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int m = n;
    
    int d = 1;
    while(m/10!=0){
      d++;
      m = m/10;
    }
    
    int count = 0;
    for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    }
    if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    }
    System.out.println(count);
  }
} public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int m = n;
    
    int d = 1;
    while(m/10!=0){
      d++;
      m = m/10;
    }
    
    int count = 0;
    for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    }
    if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    }
    System.out.println(count);
  }
} Main
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int m = n;
    
    int d = 1;
    while(m/10!=0){
      d++;
      m = m/10;
    }
    
    int count = 0;
    for(int i = 0; i < d - 1; i++){
      if(i%2==0){
        count += (int)Math.pow(10, (double)(i + 1)) - (int)Math.pow(10, (double)i);
      }
    }
    if(d%2==1){
      count += n - (int)Math.pow(10, (double)(d - 1)) + 1;
    }
    System.out.println(count);
  }
}
