NC222452. [USACOJan2021G]UdderedbutnotHerd
描述
输入描述
The only line of input contains the string of lowercase letters that Farmer Nhoj heard Mildred say. This string has length at least 1 and at most 105.
输出描述
Print the minimum number of times Mildred must have hummed the entire cowphabet.
示例1
输入:
mildredree
输出:
3
说明:
Mildred must have hummed the cowphabet at least three times. It is possible for Mildred to have only hummed the cowphabet three times if the cowphabet starts with "mildre" and Farmer Nhoj heard the letters in uppercase as denoted below.
MILDREabcfghjknopqstuvwxyz milDREabcfghjknopqstuvwxyz mildrEabcfghjknopqstuvwxyz