A street has houses on each side, for a total of houses. The addresses on the south side of the street form an arithmetic sequence, as do the addresses on the north side of the street. On the south side, the addresses are etc., and on the north side they are etc. A sign painter paints house numbers on a house for per digit. If he paints the appropriate house number once on each of these houses, how many dollars does he collect?