A snake in an grid is a path composed of straight line segments between centres of adjacent cells, going through the centres of all the grid cells, which visits each cell exactly once. Here two grid cells are considered to be adjacent if they share an edge. Note that all pieces of the snake path are parallel to grid lines. The figure shows an example of a snake in a grid. This snake makes nine turns, marked by small black squares.

Let us now consider a snake through the 2025 cells of a grid. What is the maximum possible number of turns that such a snake can make?
