Many persons are familiar with the Roman numerals for relatively small numbers. The symbols ``i'', ``v'', ``x'', ``l'', and ``c'' represent the decimal values 1, 5, 10, 50, and 100 respectively. To represent other values, these symbols, and multiples where necessary, are concatenated, with the smaller-valued symbols written further to the right. For example, the number 3 is represented as ``iii'', and the value 73 is represented as ``lxxiii''. The exceptions to this rule occur for numbers having units values of 4 or 9, and for tens values of 40 or 90. For these cases, the Roman numeral representations are ``iv'' (4), ``ix'' (9), ``xl'' (40), and ``xc'' (90). So the Roman numeral representations for 24, 39, 44, 49, and 94 are ``xxiv'', ``xxxix'', ``xliv'', ``xlix'', and ``xciv'', respectively.
The preface of many books has pages numbered with Roman numerals, starting with ``i'' for the first page of the preface, and continuing in sequence. Assume books with pages having 100 or fewer pages of preface. How many ``i'', ``v'', ``x'', ``l'', and ``c'' characters are required to number the pages in the preface? For example, in a five page preface we’ll use the Roman numerals ``i'', ``ii'', ``iii'', ``iv'', and ``v'', meaning we need 7 ``i'' characters and 2 ``v'' characters.