Knight and Pawn against Knight#308

Knight and Pawn against Knight

1 second
64 megabytes
Very easy

You are given a valid postponed chess position in which the endgame consists of a white knight and pawn against a black knight. As always, it is White's turn to move.

Your task is to determine the number of possible moves that the white knight can make. The possible moves, according to standard chess rules, are shown as red points in the figure.

Input

The first line contains the positions of the white pieces, and the second line contains the positions of the black pieces, separated by spaces. The symbols for the pieces are described in the note below.

Output

Output a single integer — the number of possible moves for the white knight.

Examples

Example 1

Loading
Loading