import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()){
String str = sc.next();
char[] s = str.toCharArray();
int x = 8;
if(s[0] == 'a' || s[0] == 'h') x-=3;
if(s[1] == '1' || s[1] == '8') x-=3;
if((s[0]=='a' && s[1]=='1') || (s[0]=='a' && s[1]=='8') ||(s[0]=='h' && s[1]=='1') || (s[0]=='h' && s[1]=='8')){
x+=1;
}
System.out.println(x);
}
}
}
02-07
261
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-25
181
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)