Start

2018-07-02 23:00 UTC

MTW

End

2018-07-09 23:00 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -322 days 11:49:59

Time elapsed

168:00:00

Time remaining

0:00:00

Problem D
Alphabet

A string of lowercase letters is called alphabetical if some of the letters can be deleted so that the only letters that remain are the letters from ā€˜aā€™ to ā€˜zā€™ in order. Given a string $s$, determine the minimum number of letters to add anywhere in the string to make it alphabetical.

Input

Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. The only line of input contains a string $s$ ($1 \le |s| \le 50$) which contains only lowercase letters.

Output

Output a single integer, which is the smallest number of letters needed to add to $s$ to make it alphabetical.

Sample Input 1 Sample Output 1
xyzabcdefghijklmnopqrstuvw
3
Sample Input 2 Sample Output 2
aiemckgobjfndlhp
20