import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int c=0;
		for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		}
		System.out.println(c);
	}
} import java.util.*; util.* java public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int c=0;
		for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		}
		System.out.println(c);
	}
} Main public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int c=0;
		for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		}
		System.out.println(c);
	} main {
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int c=0;
		for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		}
		System.out.println(c);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n=in.nextInt(); n in.nextInt() in.nextInt in int c=0; c 0 for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		} {
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		} String str=String.valueOf(i); str String.valueOf(i) String.valueOf String i if(str.length()%2!=0)
			{
				c++;
			} str.length()%2!=0 str.length()%2 str.length() str.length str 2 0 {
				c++;
			} c++ c System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int c=0;
		for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		}
		System.out.println(c);
	}
} public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int c=0;
		for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		}
		System.out.println(c);
	}
} Main
import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int c=0;
		for(int i=1;i<=n;i++)
		{
			String str=String.valueOf(i);
			if(str.length()%2!=0)
			{
				c++;
			}
		}
		System.out.println(c);
	}
}
