Two chess pieces, a rook and a knight, stand on a standard chessboard 8 × 8 in size. The positions in which they are situated are known. It is guaranteed that none of them beats the other one.

Your task is to find the number of ways to place another knight on the board so that none of the three pieces on the board beat another one. A new piece can only be placed on an empty square.

Input

The first input line contains the description of the rook's position on the board. This description is a line which is 2 in length. Its first symbol is a lower-case Latin letter from a to h, and its second symbol is a number from 1 to 8. The second line contains the description of the knight's position in a similar way. It is guaranteed that their positions do not coincide.

Output

Print a single number which is the required number of ways.

Examples

Input

a1
b2


Output

44


Input

a8
d4


Output

38

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;



public class B38 {
	
	static int x1, y1, x2, y2, l;	
	
	private void Problem() throws IOException {
		String s1 = nextToken(), s2 = nextToken();
		coords(s1, s2);
		for (int i = 1; i < 9; i ++) {
			for (int j = 1; j < 9; j ++) {
				if (stop(x1,y1,x2,y2,i,j)) l ++;
			}
		}
		System.out.println(l);
	}
	
	BufferedReader in;
	StringTokenizer tokenizer;
	
	public void Solution() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		Problem();
		in.close();
	}
	
	public static void main(String[] args) throws IOException {
		new B38().Solution();
	}
	
	private void coords(String s1, String s2) {
		x1 = s1.charAt(0) - 'a' + 1;
		y1 = s1.charAt(1) - 48;
		x2 = s2.charAt(0) - 'a' + 1;
		y2 = s2.charAt(1) - 48;
	}
	
	private boolean stop(int x1, int y1, int x2, int y2, int x3, int y3) {
		if (x3 == x1 || y3 == y1) return false;
		if (x2 == x3 && y2 == y3) return false;
		if (kon(x1,y1,x3,y3)) return false;
		if (kon(x2,y2,x3,y3)) return false;
		return true;
	}
	
	private boolean kon(int x, int y, int kx, int ky) {
		if (x == kx - 1 && y == ky + 2 || x == kx + 1 && y == ky + 2 || x == kx - 2 && y == ky + 1 || x == kx + 2 && y == ky + 1 || x == kx - 2 && y == ky -1 || x == kx + 2 && y == ky -1 || x == kx - 1 && y == ky -2 || x == kx + 1 && y == ky -2)
			return true;
		return false;
	}
	
	String nextToken() throws IOException {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(in.readLine());
        }
        return tokenizer.nextToken();
    }
	
	int nextInt() throws IOException, NumberFormatException {
		return Integer.parseInt(nextToken());
	}
	
	long nextLong() throws IOException, NumberFormatException {
		return Long.parseLong(nextToken());
	}
	
	double nextDouble() throws IOException, NumberFormatException {
        return Double.parseDouble(nextToken());
    }
}