FUCT_SU20_SE1502_T05

Start

2020-07-21 15:30 AKDT

FUCT_SU20_SE1502_T05

End

2020-07-21 17:45 AKDT
The end is near!
Contest is over.
Not yet started.
Contest is starting in -58 days 17:22:13

Time elapsed

2:15:00

Time remaining

0:00:00

Problem J
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