The side view of the Minecraft game world is represented as a rectangular grid of dimensions $$$h \times w$$$ — a vertical cross-section of the ground. Each cell in this grid can be empty, occupied by a dirt block, or occupied by a gold block. Beneath the bottom edge of the grid lies lava. Each block is supported either by another block or by lava. Additionally, gravity operates in Minecraft; thus, an object will fall downward if it lacks support.
Initially, the player stands on an empty cell located above the leftmost occupied cell.
The player may perform the following actions:
The objective of the player is to mine all gold blocks and reach the right edge of the grid using the minimum number of block creation and destruction operations.
The first line of the input file contains two integers $$$h$$$ and $$$w$$$ ($$$5 \leq h, w \leq 100$$$) — the height and width of the grid, respectively. The next $$$h$$$ lines contain $$$w$$$ characters each, describing the grid: the character "." denotes an empty cell, the character "#" denotes a dirt block, and the character "G" denotes a gold block. There are no gold blocks on the left and right boundaries. All cells at the top boundary are empty. All cells at the bottom boundary are occupied by dirt blocks. There is no empty block located underneath any occupied block.
The output file should contain a single integer — the minimum number of block creation and destruction operations required to achieve the objective.
5 5 ..... #..#. ##.## #GGG# #####
5
5 5 ..... #..G. #..## ##### #####
1
8 5 ..... ..... ....# ....# ....# .#.G# ##### #####
4
| Name |
|---|


