p.115
first_p=input()
steps=[(2,-1),(2,1),(-2,-1),(-2,1),(1,-2),(-1,-2),(1,2),(-1,2)]
count=0
# 맨 처음이 a,1
column=int(ord(first_p[0])-ord('a'))+1
row=int(first_p[1])
next_column=0
next_row=0
for step in steps:
next_column=column+step[0]
next_row=row+step[1]
if next_column>=1 and next_column<=8 and next_row>=1 and next_row<=8:
count+=1
print(count)
댓글