# Task
 Vanya gets bored one day and decides to enumerate a large pile of rocks. He first counts the rocks and finds out that he has `n` rocks in the pile, then he goes to the store to buy labels for enumeration. 
 
 Each of the labels is a digit from 0 to 9 and each of the `n` rocks should be assigned a unique number from `1` to `n`.

 If each label costs `$1`, how much money will Vanya spend on this project?

# Input/Output


 - `[input]` integer `n`

  The number of rocks in the pile.

  `1  ≤  n  ≤  10^9`


 - `[output]` an integer

  the cost of the enumeration.
  
# Example

 For `n = 13`, the result should be `17`.
 ```
 the numbers from 1 to n are:
 1 2 3 4 5 6 7 8 9 10 11 12 13
 we need 17 single digit labels:
 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3
 each label cost $1, so the output should be 17.
 ```

Source: codewars | Difficulty: EASY

Starter code: def rocks(n):
	

Solutions:
from math import log10

def rocks(n):
	return (n + 1) * int(log10(n) + 1) - (10 ** int(log10(n) + 1) - 1) // 9


def rocks(n):
	(ini, c) = ('9' * len(str(n)[:-1]), 0)
	while ini:
		c += (n - int(ini)) * len(str(n))
		(n, ini) = (int(ini), ini[:-1])
	return c + n


def rocks(n):
	cost = 0
	digits = 0
	while n >= 10 ** (digits + 1):
		digits += 1
		cost += (10 ** digits - 10 ** (digits - 1)) * digits
	cost += (n - 10 ** digits + 1) * (digits + 1)
	return cost


def rocks(n):
	l = len(str(n))
	return int(n + 1 - 10 ** (l - 1)) * l + sum((9 * i * 10 ** (i - 1) for i in range(l)))


def rocks(n):
	(r, p, i) = (0, 1, 1)
	while p * 9 < n:
		r += 9 * p * i
		n -= 9 * p
		p *= 10
		i += 1
	return r + n * i


def rocks(n):
	tot = 0
	for i in range(10):
		if n >= 10 ** (i + 1):
			tot += 9 * (i + 1) * 10 ** i
		else:
			tot += (1 + n - 10 ** i) * (i + 1)
			break
	return tot


from math import log10

def rocks(n):
	i = int(log10(n))
	return sum((j * 9 * 10 ** (j - 1) for j in range(1, i + 1))) + (i + 1) * (n - 10 ** i + 1)