Consider the number with 224 digits, the first of which is 5 and the other 223 digits are 9's.
The sum of the digits is 5+9(223)=5+2007=2012.
Can there be a smaller number? Reducing the leading digit requires an increase in the number of digits, thus leading to a larger number. Also reducing one of the nines requires adding a digit, thus creating a larger number.
So the first digit is 5.