시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 1 1 1 100.000%

문제

The year is 46, B.C. Gaius Julius Caesar is the most powerful ruler in the world.

The newly named “imperator”, busy consolidating his power in Rome and waging wars abroad, needs a secure way to send messages to his representatives around the Roman world.

The now world-famous solution to this problem is the eponymous Caesar cipher, an encoding in which every letter from the plaintext is rotated through the alphabet by a fixed shift distance. For example, when encoded using a shift distance of 3, alexandra becomes dohadqgud.

Caesar is a master of strategy—he knows the value of an effective double-bluff and will not hesitate to use one. In fact, when possible, he will even send some messages with a shift distance of 0 to really confuse his enemies.

However, after a run in with the soothsayer Spurina, Caesar has become a worried man. He will hear no talk of any “i”s of March and so, wants to send only messages where the ciphertext contains no “i”s!

Given the plaintext of a message, how many distinct “i-free” shifts could be used for the encoding?

입력

The input consists of:

  • one line containing the plaintext w. w will be at least one character long and no more than 100 characters in length. It will contain only lower-case letters.

출력

If at least one “i-free” shift of w can be found, output the number of distinct shift distances that could be used.

Otherwise, output impossible.

You may consider 0 as a valid shift distance provided it does not lead to any “i”s.

예제 입력 1

erratum

예제 출력 1

20

예제 입력 2

agricola

예제 출력 2

19

예제 입력 3

thequickbrownfoxjumpsoverthelazydog

예제 출력 3

impossible