
On a chessboard, a queen, a rook, and a bishop of the same color are placed. How many squares on the board are attacked by at least one of these pieces?
The rook (R) moves only horizontally and vertically, the bishop (B) moves only diagonally, and the queen (Q) moves both horizontally, vertically, and diagonally.
In the figure, red dots mark the squares attacked only by the queen, blue dots indicate those attacked only by the rook, and green dots indicate those attacked only by the bishop. Yellow dots denote the squares simultaneously attacked by the queen and the rook, brown dots — by the queen and the bishop, and the light blue dot marks the square attacked by both the bishop and the rook.
A single line in international chess notation (see the sample input) contains the positions of the queen, rook, and bishop (in any order), separated by spaces. All input data is valid.
Output a single integer — the number of squares on the chessboard attacked by at least one of the pieces.
Example 1