public class Main {
    public static void main(String[] args) {

        //write your code here........
        long sum = 0;
        for (long i = 9;  i <= 9999999999l;){
            sum += i;
            i = i * 10 + 9;
        }
        System.out.print(sum);
    }
}