If the numbers 1 to 5 are written out in words: one, two, three, four, five, there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to n (inclusive) were written out in words, how many letters would be used? Use British usage: 'and' is used after hundreds (e.g. 'three hundred and forty-two'). Do not count spaces or hyphens.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 1000
Tags:
