How much do I have to write?
05AB1E, 3 bytes
Code:
ÝJg
Uses the CP-1252 encoding. Try it online!
Explanation:
Ý # Range [0 .. input]
J # Join into one string
g # Get the length of the string
Python 2, 55 46 bytes
lambda n:len(`range(abs(n)+1)`)+2*~n+3*n*(n<0)
Try it online!
Getting better.
Röda, 23 bytes
f x{[#([seq(0,x)]&"")]}
Try it online!
Explained:
f x{[#([seq(0,x)]&"")]}
f x{ } /* Defines function f with parameter x. */
seq(0,x) /* Creates a stream of numbers from 0 to x. */
[ ] /* Creates an array. */
&"" /* Joins with "". */
#( ) /* Calculates the length of the resulting string. */
[ ] /* Returns the value. */