Preparando MOJI

King Moves

1000ms 262144K

Description:

The only king stands on the standard chess board. You are given his position in format "cd", where c is the column from 'a' to 'h' and d is the row from '1' to '8'. Find the number of moves permitted for the king.

Check the king's moves here https://en.wikipedia.org/wiki/King_(chess).

King moves from the position e4

Input:

The only line contains the king's position in the format "cd", where 'c' is the column from 'a' to 'h' and 'd' is the row from '1' to '8'.

Output:

Print the only integer x — the number of moves permitted for the king.

Sample Input:

e4

Sample Output:

8

Informação

Codeforces

Provedor Codeforces

Código CF710A

Tags

implementation

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:08:46

Relacionados

Nada ainda