In a $5 \times 9$ checkered rectangle, the middle row and middle column are colored gray. You leave the corner cell and move to the cell adjacent to the side with each move. For each transition from a gray cell to a gray one you need to pay a ruble. What is the smallest number of rubles you need to pay to go around all the squares of the board exactly once (it is not necessary to return to the starting square)?