Rotary Dial

No attempts yetTime limit1sMemory limit128 MB

Problem

Sang-geun's grandmother uses an old rotary dial telephone like the one shown below.

To dial a number, you press the digit you want and then turn the dial clockwise until it reaches the metal pin. Pressing a digit returns the dial to its starting position, so to dial the next digit you must turn it again from the start.

Dialing the digit $1$ takes $2$ seconds. Dialing a digit larger than $1$ takes more time: each position further along adds $1$ second. In other words, dialing digit $n$ takes $n+1$ seconds, and $0$ sits one position past $9$, so it takes $11$ seconds.

Sang-geun's grandmother memorizes phone numbers as the letters that correspond to each digit. On the dial, letters map to digits as follows.

DigitLetters
2A, B, C
3D, E, F
4G, H, I
5J, K, L
6M, N, O
7P, Q, R, S
8T, U, V
9W, X, Y, Z

To dial a word, you dial the digit for each letter in order. For example, UNUCIC corresponds to $868242$.

Given the word your grandmother memorized, write a program that finds the minimum time needed to dial this phone number.

Input

The first line contains a word made up of uppercase letters only. The length of the word is between $2$ and $15$, inclusive.

Output

Print the minimum time, in seconds, needed to dial the phone number for the given word.