import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		}
		System.out.println(ans);
	}
}
	 import java.util.*; util.* java import java.io.*; io.* java public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		}
		System.out.println(ans);
	} main {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		}
		System.out.println(ans);
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) int n=in.nextInt(); n in.nextInt() in.nextInt in int ans=0; ans 0 for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		} {
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		} int tep=i; tep i int len=0; len 0 while(tep>0)
			{
				tep=tep/10;
				len++;
			} tep>0 tep 0 {
				tep=tep/10;
				len++;
			} tep=tep/10 tep tep/10 tep 10 len++ len if(len%2==1)
			{
				ans++;
			} len%2==1 len%2 len 2 1 {
				ans++;
			} ans++ ans 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 in=new Scanner(System.in);
		int n=in.nextInt();
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		}
		System.out.println(ans);
	}
} public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			int tep=i;
			int len=0;
			while(tep>0)
			{
				tep=tep/10;
				len++;
			}
			if(len%2==1)
			{
				ans++;
			}
		}
		System.out.println(ans);
	}
}
	