public class Main { public static void main(String[] args) { //write your code here........ long sum = 0; for (long i = 10; i <= 10000000000L; i *= 10) { sum += i - 1; } System.out.println(sum); } }