n = input()
r = int(n[1])
c = int(ord(n[0])) - 96
d = [(-2, -1), (-1, -2), (1, -2), (2, -1), (2, 1), (1, 2), (-1, 2), (-2, 1)]
dap = 0
for direction in d:
n_r = r + direction[0]
n_c = c + direction[1]
if n_r >= 1 and n_r <= 8 and n_c >= 1 and n_c <= 8:
dap += 1
print(dap)
'Python > 이것이 취업을 위한 코딩 테스트다(with 파이썬)' 카테고리의 다른 글
DFS,BFS - 음료수 얼려먹기 (0) | 2022.06.26 |
---|---|
구현 - 게임 개발 (0) | 2022.06.26 |
구현 - 시각 (0) | 2022.06.26 |
구현 - 상하좌우 (0) | 2022.06.26 |
이것이 취업을 위한 코딩 테스트다 무지의 먹방 라이브 (1) | 2022.05.29 |