You just bought a piece of land and want to plant the largest rectangular field you can. Surveying the land turns up several obstacles, so you draw a map. Each square of the map records what is on it: grass (G), rock (R), water (W), shrubs (S), or trees (T). You can mow the grass and dig out the shrubs, but water, rocks, and trees cannot be removed.
Given the map, find the area of the largest rectangle made only of squares you can clear. The sides of the rectangle must run along the grid lines.