import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        //1桁
        if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        //1桁
        if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        }
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        //1桁
        if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        }
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        //1桁
        if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        } N/10 == 0 N/10 N 10 0 {
            System.out.println(N%10);
        //2桁
        } System.out.println(N%10) System.out.println System.out System System.out N%10 N 10 if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        } N/100 == 0 N/100 N 100 0 {
            System.out.println(9);
        //3桁
        } System.out.println(9) System.out.println System.out System System.out 9 if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        } N/1000 == 0 N/1000 N 1000 0 {
            System.out.println(N%1000-99+9);
        //4桁
        } System.out.println(N%1000-99+9) System.out.println System.out System System.out N%1000-99+9 N%1000-99 N%1000 N 1000 99 9 if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        } N/10000 == 0 N/10000 N 10000 0 {
            System.out.println(909);
        //5桁
        } System.out.println(909) System.out.println System.out System System.out 909 if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        } N/100000 == 0 N/100000 N 100000 0 {
            System.out.println(N%100000-9999+900+9);
        //100000
        } System.out.println(N%100000-9999+900+9) System.out.println System.out System System.out N%100000-9999+900+9 N%100000-9999+900+9 N%100000-9999 N%100000 N 100000 9999 900 9 {
            System.out.println(90909);
        } System.out.println(90909) System.out.println System.out System System.out 90909 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        //1桁
        if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        //1桁
        if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        //1桁
        if(N/10 == 0){
            System.out.println(N%10);
        //2桁
        }else if(N/100 == 0){
            System.out.println(9);
        //3桁
        }else if(N/1000 == 0){
            System.out.println(N%1000-99+9);
        //4桁
        }else if(N/10000 == 0){
            System.out.println(909);
        //5桁
        }else if(N/100000 == 0){
            System.out.println(N%100000-9999+900+9);
        //100000
        }else{
            System.out.println(90909);
        }
    }
}
