
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		 Scanner scn=new Scanner(System.in);
		 int n=scn.nextInt();
		 int digit=1,count=0;
		 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 }
		 System.out.println(count);
	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		 Scanner scn=new Scanner(System.in);
		 int n=scn.nextInt();
		 int digit=1,count=0;
		 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 }
		 System.out.println(count);
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		 Scanner scn=new Scanner(System.in);
		 int n=scn.nextInt();
		 int digit=1,count=0;
		 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 }
		 System.out.println(count);
	} main {
		// TODO Auto-generated method stub
		 Scanner scn=new Scanner(System.in);
		 int n=scn.nextInt();
		 int digit=1,count=0;
		 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 }
		 System.out.println(count);
	} Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int n=scn.nextInt(); n scn.nextInt() scn.nextInt scn int digit=1 digit 1 count=0; count 0 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 } {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 } if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 } i%10==0 i%10 i 10 0 {
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 } int tmp=0 tmp 0 x=i; x i while(x!=0) {
					 x=x/10;
					 tmp++;
				 } x!=0 x 0 {
					 x=x/10;
					 tmp++;
				 } x=x/10 x x/10 x 10 tmp++ tmp digit=tmp digit tmp if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 } digit%2!=0 digit%2 digit 2 0 {
				// System.out.println(i);
					 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) {
		// TODO Auto-generated method stub
		 Scanner scn=new Scanner(System.in);
		 int n=scn.nextInt();
		 int digit=1,count=0;
		 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 }
		 System.out.println(count);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		 Scanner scn=new Scanner(System.in);
		 int n=scn.nextInt();
		 int digit=1,count=0;
		 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 }
		 System.out.println(count);
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		 Scanner scn=new Scanner(System.in);
		 int n=scn.nextInt();
		 int digit=1,count=0;
		 for(int i=1;i<=n;i++) {
			 if(i%10==0){
				 int tmp=0,x=i;
				 while(x!=0) {
					 x=x/10;
					 tmp++;
				 }
				 digit=tmp;
			 }
			 if(digit%2!=0) {
				// System.out.println(i);
					 count++;				 
			 }
		 }
		 System.out.println(count);
	}

}
