def len_board(board):
    """Function count elements (X and O) on the board and return integer."""
    counter = 0
    for line in board:
        for cell in line:
            if cell != ".":
                counter += 1
    return counter