Bob is biking on a trail with U
, D
, and F
, respectively. He starts with a speed of
- On uphill sections, Bob will lose
unit of speed. - On downhill sections, Bob will gain
unit of speed. - On flat sections, Bob's speed will not change.
If Bob's speed becomes
How many total sections will Bob have to walk on?
Constraints
Input Specification
The first line will contain two space-separated integers
The second and final line will contain a string of length U
, D
, and F
.
Output Specification
Output one integer on one line, the number of sections Bob will have to walk on.
Sample Input
11 1
FUDDDUDUUUF
Sample Output
3
Explanation
Bob has to walk the second section and from the tenth section to the end of the trail, as in these sections, his speed is
Comments