UChicago Practice Contest 2018-04-28

#### Start

2018-04-28 17:00 UTC

## UChicago Practice Contest 2018-04-28

#### End

2018-04-28 22:00 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -329 days 3:21:05

5:00:00

0:00:00

# Problem AAlphabet

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