import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int len = String.valueOf(n).length();
    int res = 0;
    for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    }

    if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    }

    System.out.println(res);
  }
} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int len = String.valueOf(n).length();
    int res = 0;
    for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    }

    if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    }

    System.out.println(res);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int len = String.valueOf(n).length();
    int res = 0;
    for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    }

    if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    }

    System.out.println(res);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int len = String.valueOf(n).length();
    int res = 0;
    for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    }

    if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    }

    System.out.println(res);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int len = String.valueOf(n).length(); len String.valueOf(n).length() String.valueOf(n).length String.valueOf(n) String.valueOf String n int res = 0; res 0 for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    } int i = 1; int i = 1; i 1 i < len i len i += 2 i += 2 i 2 {
      res += 9 * (int) Math.pow(10, i - 1);
    } {
      res += 9 * (int) Math.pow(10, i - 1);
    } res += 9 * (int) Math.pow(10, i - 1) res 9 * (int) Math.pow(10, i - 1) 9 (int) Math.pow(10, i - 1) Math.pow Math 10 i - 1 i 1 if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    } len % 2 == 1 len % 2 len 2 1 {
      res += n - (int) Math.pow(10, len - 1) + 1;
    } res += n - (int) Math.pow(10, len - 1) + 1 res n - (int) Math.pow(10, len - 1) + 1 n - (int) Math.pow(10, len - 1) n (int) Math.pow(10, len - 1) Math.pow Math 10 len - 1 len 1 1 System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int len = String.valueOf(n).length();
    int res = 0;
    for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    }

    if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    }

    System.out.println(res);
  }
} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int len = String.valueOf(n).length();
    int res = 0;
    for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    }

    if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    }

    System.out.println(res);
  }
} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int len = String.valueOf(n).length();
    int res = 0;
    for (int i = 1; i < len; i += 2) {
      res += 9 * (int) Math.pow(10, i - 1);
    }

    if (len % 2 == 1) {
      res += n - (int) Math.pow(10, len - 1) + 1;
    }

    System.out.println(res);
  }
}