Chessboard in FEN
In FEN (Forsyth–Edwards Notation), a chessboard is described as follows:
is the FEN notation description of the following chessboard:
The chessboard of the beginning of a chess game is described in FEN as:
Your task is simple: given a chessboard description in FEN notation, you are asked to compute the number of unoccupied squares on the board which are not attacked by any piece.
The input is a sequence of lines, each line containing the FEN description of a chessboard. Note that the description does not necessarily give a legal chess position. Input lines do not contain whitespaces.
For each line of input, output one line containing an integer which gives the number of unoccupied squares which are not attacked.
Output for Sample Input
|University of Debrecen; Faculty of Informatics; v. 03/01/2019|