Every winter, flamingos visit Larnaca Salt Lake in Cyprus. As rain fills the lake, more shallow water becomes available for the birds. To study how the flamingos spread out, consider the following simplified model. Initially, a rectangular lake consists of a single cell, and that cell contains a flamingo.
There are $$$n$$$ events. In each event, the lake expands either by one row along its entire southern side, or by one column along its entire eastern side.
For each newly added cell, a flamingo arrives if none of the old cells sharing a side or a corner with it contains a flamingo. Here, old cells are the cells that belonged to the lake before this event. All new cells are checked simultaneously: flamingos arriving during the same event do not affect each other. Flamingos that have already arrived stay in their cells.
Help scientists find the total number of flamingos at the lake after all events.
The first line contains an integer $$$n$$$ ($$$1\le n\le 10^6$$$), the number of events.
The second line contains a string of $$$n$$$ characters. The $$$i$$$-th character is S if the $$$i$$$-th event adds a row to the south, or E if it adds a column to the east.
Print one integer: the number of flamingos at the lake after all events.
4SSEE
5
10SEESSSEEES
12
Illustrations for the examples:
![]() | ![]() |
| Name |
|---|


