#P1246. 编码

编码

Description

Encoding is often used for ciphertext or compressed transmission. Here we use one of the simplest methods: map some structured words to numbers.

There are 2626 letters in the alphabet, a,b,c,,z\mathtt{a,b,c,\cdots,z}. These special words have length at most 66, and their letters are in strictly increasing order. Put all such words together and sort them in lexicographic order. The code of a word is the position of that word in this dictionary.

For example:

  • a1\verb!a! \to 1.
  • b2\verb!b! \to 2.
  • z26\verb!z! \to 26.
  • ab27\verb!ab! \to 27.
  • ac28\verb!ac! \to 28.

Your task is to compute the code of the given word.

Input Format

A single line containing the word to be encoded.

Output Format

A single line containing the corresponding code. If the word is not in this dictionary, output 00.

ab

27

Hint

Translated by ChatGPT 5