python count characters in string dictionary