import java.util.*;

public class Main {
  public static void main(String[] args) {
    int N;
    try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    }
    int maxKeta = (int)Math.floor(Math.log10((double)N) + 1);
    int answer = 0;
    if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    }
    if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    }
    System.out.println(answer);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    int N;
    try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    }
    int maxKeta = (int)Math.floor(Math.log10((double)N) + 1);
    int answer = 0;
    if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    }
    if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    }
    System.out.println(answer);
  }
} Main public static void main(String[] args) {
    int N;
    try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    }
    int maxKeta = (int)Math.floor(Math.log10((double)N) + 1);
    int answer = 0;
    if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    }
    if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    }
    System.out.println(answer);
  } main {
    int N;
    try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    }
    int maxKeta = (int)Math.floor(Math.log10((double)N) + 1);
    int answer = 0;
    if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    }
    if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    }
    System.out.println(answer);
  } int N; N try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    } {
      N = sc.nextInt();
    } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc int maxKeta = (int)Math.floor(Math.log10((double)N) + 1); maxKeta (int)Math.floor(Math.log10((double)N) + 1) Math.floor Math Math.log10((double)N) + 1 Math.log10((double)N) Math.log10 Math (double)N 1 int answer = 0; answer 0 if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    } maxKeta >= 2 maxKeta 2 {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    } int n = (int)Math.floor((maxKeta - 2)/2); n (int)Math.floor((maxKeta - 2)/2) Math.floor Math (maxKeta - 2)/2 (maxKeta - 2) maxKeta 2 2 int M = 2 * n + 1; M 2 * n + 1 2 * n 2 n 1 answer += ((int)(Math.pow(-10,(M+1)))-1)/11 answer ((int)(Math.pow(-10,(M+1)))-1)/11 ((int)(Math.pow(-10,(M+1)))-1) (int)(Math.pow(-10,(M+1))) Math.pow Math -10 10 (M+1) M 1 1 11 if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    } maxKeta % 2 == 1 maxKeta % 2 maxKeta 2 1 {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    } answer += N - (int)(Math.pow(10,maxKeta-1)) + 1 answer N - (int)(Math.pow(10,maxKeta-1)) + 1 N - (int)(Math.pow(10,maxKeta-1)) N (int)(Math.pow(10,maxKeta-1)) Math.pow Math 10 maxKeta-1 maxKeta 1 1 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
  public static void main(String[] args) {
    int N;
    try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    }
    int maxKeta = (int)Math.floor(Math.log10((double)N) + 1);
    int answer = 0;
    if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    }
    if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    }
    System.out.println(answer);
  }
} public class Main {
  public static void main(String[] args) {
    int N;
    try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    }
    int maxKeta = (int)Math.floor(Math.log10((double)N) + 1);
    int answer = 0;
    if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    }
    if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    }
    System.out.println(answer);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    int N;
    try(Scanner sc = new Scanner(System.in)) {
      N = sc.nextInt();
    }
    int maxKeta = (int)Math.floor(Math.log10((double)N) + 1);
    int answer = 0;
    if ( maxKeta >= 2 ) {
	    int n = (int)Math.floor((maxKeta - 2)/2);
    	int M = 2 * n + 1;
    	answer += ((int)(Math.pow(-10,(M+1)))-1)/11;
    }
    if ( maxKeta % 2 == 1 ) {
      answer += N - (int)(Math.pow(10,maxKeta-1)) + 1;
    }
    System.out.println(answer);
  }
}