import java.util.*;
public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			sc.close();
			for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			}
			System.out.println(res);
		}
	public static void main(String[] args) {
		solve();

	}

} import java.util.*; util.* java public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			sc.close();
			for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			}
			System.out.println(res);
		}
	public static void main(String[] args) {
		solve();

	}

} Main static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			sc.close();
			for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			}
			System.out.println(res);
		} solve {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			sc.close();
			for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			}
			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 res = 0; res 0 sc.close() sc.close sc for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			} int i = 1; int i = 1; i 1 i<=n i n i++ i++ i {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			} {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			} String s =String.valueOf(i); s String.valueOf(i) String.valueOf String i if(s.length()%2!=0){
					res++;
				} s.length()%2!=0 s.length()%2 s.length() s.length s 2 0 {
					res++;
				} res++ res System.out.println(res) System.out.println System.out System System.out res public static void main(String[] args) {
		solve();

	} main {
		solve();

	} solve() solve String[] args args public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			sc.close();
			for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			}
			System.out.println(res);
		}
	public static void main(String[] args) {
		solve();

	}

} public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			sc.close();
			for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			}
			System.out.println(res);
		}
	public static void main(String[] args) {
		solve();

	}

} Main
import java.util.*;
public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			sc.close();
			for(int i = 1;i<=n;i++) {
				String s =String.valueOf(i);
				if(s.length()%2!=0){
					res++;
				}
			}
			System.out.println(res);
		}
	public static void main(String[] args) {
		solve();

	}

}
