changed function name countNumbers to countDigits

changed the function countNumbers to countDigits as it is more suitable.
Added countNumbers template function

Added the countNumbers template function.