program Skaitmenys;

  const PRF = 'skait.in';
        RZF = 'skait.out';
  var   f: text;
        N, sktm, z, d: longint;
  
begin
  //skaitymas
  assign(f, PRF);
  reset(f);
  readln(f, N);
  close (f);
  
  //sprendimas
  sktm := 0;
  z := 1; // keliaženklis skaičius;
  d := 1; //dešimties laipsnis
  while N >= d * 9 do begin
    sktm := sktm + 9 * z * d;
    N := N - 9 * d;
    z := z + 1;
    d := d * 10;
  end;
  sktm := sktm + N * z;
  
  //rašymas
  assign(f, RZF);
  rewrite(f);
  writeln(f, sktm);
  close(f);
end.
    
  