fork(2) download
  1. __author__ = 'Zlobober'
  2.  
  3. n = int(raw_input())
  4. ans = 0
  5. for l in range(1, 11):
  6. if (l == len(str(n))):
  7. ans += (n - 10**(l-1) + 1) * l
  8. elif (l < len(str(n))):
  9. ans += (9 * 10**(l - 1)) * l
  10. else:
  11. break
  12.  
  13. print ans
Runtime error #stdin #stdout #stderr 0.01s 7692KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 3, in <module>
EOFError: EOF when reading a line