https://www.acmicpc.net/problem/1748
import java.util.Scanner;
public class Main {
static int zero(int n){
int z=1;
if(n<=0) z=0;
else{
for(int i=1;i<=n-1;i++){
z*=10;
}
}
return z;
}
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
String k=Integer.toString(n);
int len=k.length();
int count=10;
int num=0;
while(n>0){
num+=(n-zero(len)+1)*len;
n=zero(len)-1;
len--;
}
System.out.print(num);
}
}