import java.util.Scanner;

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

		int cnt = 0;
		for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	}
} 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 cnt = 0;
		for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int cnt = 0;
		for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int cnt = 0;
		for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		} int i = 0; int i = 0; i 0 i < 6 i 6 i++ i++ i {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		} {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		} for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			} int j = 1; int j = 1; j 1 j <= N j N j++ j++ j {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			} {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			} if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				} j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i)) j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i)) j <= N j N j < Math.pow(10,(2*i+1)) j Math.pow(10,(2*i+1)) Math.pow Math 10 (2*i+1) 2*i 2 i 1 j >= Math.pow(10,(2*i)) j Math.pow(10,(2*i)) Math.pow Math 10 (2*i) 2 i {
					cnt++;
				} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int cnt = 0;
		for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int cnt = 0;
		for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	}
} 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 cnt = 0;
		for (int i = 0; i < 6; i++) {
			for (int j = 1; j <= N; j++) {
				if (j <= N && j < Math.pow(10,(2*i+1)) && j >= Math.pow(10,(2*i))) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	}
}
