import java.util.Scanner;

public class Main {

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

		sc.close();

		int nLen = String.valueOf(N).length();
		int ans = 0;


		for(int i=1; i<nLen; i++) {
			if(i == 1) {
				ans += 9;
			}else if(i % 2 == 1) {
				ans += 9 * Math.pow(10, i - 1);
			}
		}
		if(nLen == 1) {
			ans += N;
		}else if(nLen%2 == 1) {
			ans += N - (Math.pow(10, nLen - 1)-1);
		}

		System.out.println(ans);

	}
} 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();

		sc.close();

		int nLen = String.valueOf(N).length();
		int ans = 0;


		for(int i=1; i<nLen; i++) {
			if(i == 1) {
				ans += 9;
			}else if(i % 2 == 1) {
				ans += 9 * Math.pow(10, i - 1);
			}
		}
		if(nLen == 1) {
			ans += N;
		}else if(nLen%2 == 1) {
			ans += N - (Math.pow(10, nLen - 1)-1);
		}

		System.out.println(ans);

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

		sc.close();

		int nLen = String.valueOf(N).length();
		int ans = 0;


		for(int i=1; i<nLen; i++) {
			if(i == 1) {
				ans += 9;
			}else if(i % 2 == 1) {
				ans += 9 * Math.pow(10, i - 1);
			}
		}
		if(nLen == 1) {
			ans += N;
		}else if(nLen%2 == 1) {
			ans += N - (Math.pow(10, nLen - 1)-1);
		}

		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		sc.close();

		int nLen = String.valueOf(N).length();
		int ans = 0;


		for(int i=1; i<nLen; i++) {
			if(i == 1) {
				ans += 9;
			}else if(i % 2 == 1) {
				ans += 9 * Math.pow(10, i - 1);
			}
		}
		if(nLen == 1) {
			ans += N;
		}else if(nLen%2 == 1) {
			ans += N - (Math.pow(10, nLen - 1)-1);
		}

		System.out.println(ans);

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

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

		sc.close();

		int nLen = String.valueOf(N).length();
		int ans = 0;


		for(int i=1; i<nLen; i++) {
			if(i == 1) {
				ans += 9;
			}else if(i % 2 == 1) {
				ans += 9 * Math.pow(10, i - 1);
			}
		}
		if(nLen == 1) {
			ans += N;
		}else if(nLen%2 == 1) {
			ans += N - (Math.pow(10, nLen - 1)-1);
		}

		System.out.println(ans);

	}
} public class Main {

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

		sc.close();

		int nLen = String.valueOf(N).length();
		int ans = 0;


		for(int i=1; i<nLen; i++) {
			if(i == 1) {
				ans += 9;
			}else if(i % 2 == 1) {
				ans += 9 * Math.pow(10, i - 1);
			}
		}
		if(nLen == 1) {
			ans += N;
		}else if(nLen%2 == 1) {
			ans += N - (Math.pow(10, nLen - 1)-1);
		}

		System.out.println(ans);

	}
} Main
import java.util.Scanner;

public class Main {

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

		sc.close();

		int nLen = String.valueOf(N).length();
		int ans = 0;


		for(int i=1; i<nLen; i++) {
			if(i == 1) {
				ans += 9;
			}else if(i % 2 == 1) {
				ans += 9 * Math.pow(10, i - 1);
			}
		}
		if(nLen == 1) {
			ans += N;
		}else if(nLen%2 == 1) {
			ans += N - (Math.pow(10, nLen - 1)-1);
		}

		System.out.println(ans);

	}
}
