In a recent half marathon with a few thousand runners, the race numbers began at 1 and counted upwards in the usual way.

I happened to notice that the average sum-of-digits of the four digit race numbers was precisely the same as the average sum-of-digits of the three digit race numbers. I also happened to notice that the very highest number was an exact multiple of 17.

How many runners were there?