Compute number of possible arrangements in the battleship game