from typing import Counter


def get_piece(turn, grid):
    """Counts the current piece on the grid

    :param turn: "X" or "O"
    :param grid: A 2-dimensional 7x7 list
    :return: Number of pieces of "turn" on the grid
    """

    grid_combined = []

    for row in grid:
        grid_combined += row

    counter = Counter(tuple(grid_combined))

    return counter[turn]