import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int a = 10;
    int i = 1;
    int count = 0;
    while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    }
    a /= 10;
    if (N >= a) {
      count += N - a + 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 a = 10;
    int i = 1;
    int count = 0;
    while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    }
    a /= 10;
    if (N >= a) {
      count += N - a + 1;
    }
    System.out.println(count);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int a = 10;
    int i = 1;
    int count = 0;
    while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    }
    a /= 10;
    if (N >= a) {
      count += N - a + 1;
    }
    System.out.println(count);
  } main {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int a = 10;
    int i = 1;
    int count = 0;
    while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    }
    a /= 10;
    if (N >= a) {
      count += N - a + 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 a = 10; a 10 int i = 1; i 1 int count = 0; count 0 while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    } N >= a N a {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    } int j = 9; j 9 for (int k = 1; k < i; k++) j *= 10; int k = 1; int k = 1; k 1 k < i k i k++ k++ k j *= 10; j *= 10 j 10 count += j count j i += 2 i 2 a *= 100 a 100 a /= 10 a 10 if (N >= a) {
      count += N - a + 1;
    } N >= a N a {
      count += N - a + 1;
    } count += N - a + 1 count N - a + 1 N - a N a 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 a = 10;
    int i = 1;
    int count = 0;
    while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    }
    a /= 10;
    if (N >= a) {
      count += N - a + 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 a = 10;
    int i = 1;
    int count = 0;
    while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    }
    a /= 10;
    if (N >= a) {
      count += N - a + 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 a = 10;
    int i = 1;
    int count = 0;
    while (N >= a) {
      int j = 9;
      for (int k = 1; k < i; k++) j *= 10;
      count += j;
      i += 2;
      a *= 100;
    }
    a /= 10;
    if (N >= a) {
      count += N - a + 1;
    }
    System.out.println(count);
  }
}
