def solution(board):
answer = []
n = len(board)
new = board.copy()
for i in range(n):
for j in range(n):
if board[i][j] == 1:
for k in range(max(0,i-1),min(i+2,n)):
for kk in range(max(0,j-1),min(j+2,n)):
if board[k][kk] == 0:
board[k][kk] = 2
# if j-1 >= 0 and board[i][j-1]==0:
# board[i][j-1]
# if j+1 < n:
for b in board:
answer += b
return answer.count(0)