POJ 1016: Numbers That Count