import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
	
	if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909);
	
  }
	
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
	
	if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909);
	
  }
	
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
	
	if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909);
	
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
	
	if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909);
	
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909); a < 10 a 10 System.out.println(a) System.out.println System.out System System.out a if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909); a < 100 a 100 System.out.println(9) System.out.println System.out System System.out 9 if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909); a < 1000 a 1000 System.out.println(a - 90) System.out.println System.out System System.out a - 90 a 90 if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909); a < 10000 a 10000 System.out.println(909) System.out.println System.out System System.out 909 if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909); a < 100000 a 100000 System.out.println(a - 9090) System.out.println System.out System System.out a - 9090 a 9090 System.out.println(90909) System.out.println System.out System System.out 90909 String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
	
	if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909);
	
  }
	
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
	
	if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909);
	
  }
	
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
	
	if(a < 10)
		System.out.println(a);
	else if(a < 100)
		System.out.println(9);
	else if(a < 1000)
		System.out.println(a - 90);
	else if(a < 10000)
		System.out.println(909);
	else if(a < 100000)
		System.out.println(a - 9090);
	else
		System.out.println(90909);
	
  }
	
}