Count the number of digits, letters, and special characters in a string.: Medium Programming Problem