input: Write a python function to find the minimum number of operations required to create the letter Y shape on a given n x n grid (where n is an odd number). The value of each cell in the grid is either 0, 1, or 2. The cell is considered part of the letter Y if it lies on the following:
  
  1. The diagonal from the top-left to the center.
  2. The diagonal from the top-right to the center.
  3. The vertical line from the center to the bottom border.
  
  To form the letter Y, all values in the cells that make up the Y must be identical, all values in cells not part of the Y must be identical, and the values in the Y must differ from those not in the Y. In each operation, you can change any cell's value to 0, 1, or 2.
  
  For example:
  >>> grid = [[1,2,2],[1,1,0],[0,1,0]]
  3
  >>> grid = [[0,1,0,1,0],[2,1,0,1,2],[2,2,2,0,1],[2,2,2,2,2],[2,1,2,2,2]]
  12
  
  Constraints:
  3 <= n <= 49
  n is odd.
  grid is a n x n matrix where each cell is either 0, 1, or 2.
output: def min_operations_to_form_Y(grid):
      n = len(grid)
      center = n // 2
      count_changes = [[[0 for _ in range(3)] for _ in range(3)] for _ in range(3)]
  
      for i in range(n):
          for j in range(n):
              value = grid[i][j]
              if (i == j and i <= center) or (i + j == n - 1 and i <= center) or (j == center and i >= center):
                  count_changes[value][0][0] += 1
              else:
                  count_changes[value][1][1] += 1
  
      min_operations = float('inf')
      for y in range(3):
          for not_y in range(3):
              if y != not_y:
                  operations = n * n - count_changes[y][0][0] - count_changes[not_y][1][1]
                  min_operations = min(min_operations, operations)
  
      return min_operations