A string of lowercase letters is called alphabetical if deleting zero or more of its letters can result in the alphabet string abcdefghijklmnopqrstuvwxyz
.
Given a string
Input
The input consists of a single line containing the string
It is guaranteed that a
to z
only.
Output
Print, on a single line, a single integer indicating the minimum number of letters that must be inserted in order to make the string
Sample Input 1
Copy
xyzabcdefghijklmnopqrstuvw
Sample Output 1
Copy
3
Sample Input 2
Copy
aiemckgobjfndlhp
Sample Output 2
Copy
20
Comments