import java.io.*;
import java.util.*;
public class main {
    public static void main(String[] args)throws Exception{
        Scanner in=new Scanner(new File("sum.in"));
        PrintWriter out=new PrintWriter("sum.out");
        long n=in.nextInt();
        int a=0;
        long b,d,c=0;
        b=n;
        while(b>0){
            a++;
            b=b/10;
        }
        for(int i=a;i>0;i--)
        {
            d=n;
            b=n;
            for(int j=i;j>0;j--)
                d=d/10;
            for(int j=i;j>1;j--)
                b=b/10;
            c=c+b-(d*10);
        }
        out.print(c);
        out.close();
    }
}
