import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);

		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		}
		System.out.println(count);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);

		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);

		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		}
		System.out.println(count);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);

		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		}
		System.out.println(count);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(str[0]); n Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int count = 0; count 0 for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		} {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		} if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			} i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000 i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000 i < 10 i 10 (i < 1000 && i > 99) i < 1000 i 1000 i > 99 i 99 (i < 100000 && i > 9999) && i != 100000 (i < 100000 && i > 9999) i < 100000 i 100000 i > 9999 i 9999 i != 100000 i 100000 {
				count++;
			} count++ count 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[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);

		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);

		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);

		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (i < 10 || (i < 1000 && i > 99) || (i < 100000 && i > 9999) && i != 100000) {
				count++;
			}
		}
		System.out.println(count);
	}
}