This page is still under construction.

Parts of this page are still being built. What you see may change.

I Love You, Yonsei

Time limit1.885sMemory limit1024 MB

Level

Not classified yet

Solved
No attempts yet

Problem

Do you love Yonsei?

The cheer song that Yonsei people love most,

I love you, Yonsei, Yonsei, I love you...

Statement

Hun-gyu, a Korea University student, cheered hard at the 2022 regular Yeongo match and lost consciousness. When he woke up, he was locked in a prison at Yonsei University. To escape, he must use the password tiles on the floor to enter the password ILOVEYONSEI.

The password tiles are 26 kinds of tiles laid out in a row. Each tile has an uppercase letter, and the letters go from left to right in alphabetical order. That is, the i-th tile has the i-th uppercase letter. Adjacent tiles are 1 apart. So to get from the tile with A to the tile with Z, you must move a distance of 25. To enter a letter, you must step onto the tile with that letter and jump. A jump moves a distance of 0.

The letter on the tile where Hun-gyu is currently standing is given. Hun-gyu wants to enter the whole password with the minimum movement distance.

Input

The input is given as follows.

cc

Output

Print the minimum total movement distance Hun-gyu needs to enter the entire password.

Constraints

cc is an uppercase letter from A to Z.

Examples3

  1. Example 1

    Input
    A
    
    Expected output
    92
    
  2. Example 2

    Input
    I
    
    Expected output
    84
    
  3. Example 3

    Input
    Z
    
    Expected output
    101