

def       __snake_case						( __UpperCamelCase	: list[list[int]]				,__UpperCamelCase	: int				,__UpperCamelCase	: int				,__UpperCamelCase	: set    ):



      """simple docstring"""

      A_  ,     A_						  =				len(__UpperCamelCase    ), len(grid[0]    )
      if (
          min(__UpperCamelCase				,__UpperCamelCase    ) < 0
          or row == row_length
          or col == col_length
          or (row, col) in visit
          or grid[row][col] == 1
      ):
            return 0
      if row == row_length - 1 and col == col_length - 1:
            return 1

      visit.add((row, col)    )

      A_						  =				0
      count += depth_first_search(__UpperCamelCase				,row + 1				,__UpperCamelCase				,__UpperCamelCase    )
      count += depth_first_search(__UpperCamelCase				,row - 1				,__UpperCamelCase				,__UpperCamelCase    )
      count += depth_first_search(__UpperCamelCase				,__UpperCamelCase				,col + 1				,__UpperCamelCase    )
      count += depth_first_search(__UpperCamelCase				,__UpperCamelCase				,col - 1				,__UpperCamelCase    )

      visit.remove((row, col)    )
      return count


if __name__ == "__main__":
      import doctest

      doctest.testmod()



def      UpperCAmelCase__		(UpperCamelCase_ = 10_00							):



     """simple docstring"""






     return sum(2 * a * ((a - 1) // 2) for a in range(3				,n + 1							)							)


if __name__ == "__main__":
 print(solution())




