import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int p = a;
		int k = 0;
		int result = 0;
		
		while(p>=1) {
			k++;
			p /= 10;
		}
		if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		}
		while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		}
      System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int p = a;
		int k = 0;
		int result = 0;
		
		while(p>=1) {
			k++;
			p /= 10;
		}
		if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		}
		while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		}
      System.out.println(result);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int p = a;
		int k = 0;
		int result = 0;
		
		while(p>=1) {
			k++;
			p /= 10;
		}
		if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		}
		while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		}
      System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int p = a;
		int k = 0;
		int result = 0;
		
		while(p>=1) {
			k++;
			p /= 10;
		}
		if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		}
		while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		}
      System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int p = a; p a int k = 0; k 0 int result = 0; result 0 while(p>=1) {
			k++;
			p /= 10;
		} p>=1 p 1 {
			k++;
			p /= 10;
		} k++ k p /= 10 p 10 if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		} k%2==1 k%2 k 2 1 {
			k--;
			result += a - Math.pow(10, k)+1;
		} k-- k result += a - Math.pow(10, k)+1 result a - Math.pow(10, k)+1 a - Math.pow(10, k) a Math.pow(10, k) Math.pow Math 10 k 1 while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		} k>0 k 0 {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		} if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			} k%2==1 k%2 k 2 1 {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			} result += Math.pow(10, k) - Math.pow(10, k-1) result Math.pow(10, k) - Math.pow(10, k-1) Math.pow(10, k) Math.pow Math 10 k Math.pow(10, k-1) Math.pow Math 10 k-1 k 1 k-- k System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int p = a;
		int k = 0;
		int result = 0;
		
		while(p>=1) {
			k++;
			p /= 10;
		}
		if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		}
		while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		}
      System.out.println(result);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int p = a;
		int k = 0;
		int result = 0;
		
		while(p>=1) {
			k++;
			p /= 10;
		}
		if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		}
		while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		}
      System.out.println(result);
	}
} Main
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int p = a;
		int k = 0;
		int result = 0;
		
		while(p>=1) {
			k++;
			p /= 10;
		}
		if(k%2==1) {
			k--;
			result += a - Math.pow(10, k)+1;
		}
		while(k>0) {
			if(k%2==1) {
				result += Math.pow(10, k) - Math.pow(10, k-1);
			}
          k--;
		}
      System.out.println(result);
	}
}