Today XiaoMing is playing Minecraft, an interesting game in which you can build your own virtual world.
Suddenly he found one underground maze which may contain a lot of diamonds, a precious raw material in Minecraft.
The maze consists of three components, path, soil and brick.
XiaoMing has a digging shovel with him, which can be used to dig away the soil, but not brick. The game plays in turn. Each turn XiaoMing can either move one unit of path, or dig one unit of soil(and no move this turn). He can only move to a neighboring place in four directions(up, down, left, right).Given the decription of the maze, in order to get these precious diamonds as soon as possible, can you find out the minimum turns XiaoMing has to take to get these diamonds?