python count number of digits in string