Once upon a time, our good friend Minim Tsoi went to the Intergalactic Programming Olympiad. It turns out that if you win this Olympiad, you will be given a lot of money, and you will be honored. Finding his motivation, Minim decided to give up all the benefits until the Olympiad and devote himself entirely to preparation.
But here's the problem, Minim needs to eat and sleep at least. After thinking for a bit, he made a list of hours when he can eat and sleep. There is no hour when he can both eat and sleep. In each hour, Minim can either eat or sleep. Also, Minim, unfortunately, is just a human, so he can go without sleep for $$$a$$$ hours, and without food for $$$b$$$ hours. Since he needs to train a lot for the honor, he wants to minimize the total time he spends eating and sleeping. Help Minim find out how many hours he will spend on useless things. The last time he ate and slept was at hour 0.
For clarification, let's say he last ate at hour $$$x$$$. Then, if from time $$$x+1$$$ to time $$$x+b$$$ inclusive, he doesn't eat, then Minim will die, and it will be very sad... The same goes for sleep.
The first line contains three numbers $$$n$$$, $$$a$$$, and $$$b$$$ - the number of hours until the Olympiad and how long he can go without sleep and food, respectively. ($$$1 \le a, b \le n \le 100$$$)
The second line contains one string $$$c$$$ of length $$$n$$$ and consisting of lowercase letters 's' and 'e'. If $$$c_i$$$ = 's', then in hour $$$i$$$ he can sleep, and vice versa.
One number - the answer to the problem. If there is no such schedule in which Minim would not die, then output -1.
5 3 3 seses
3
10 5 4 sesseseess
5
5 1 2 seees
-1
In the first example, he eats at hour 2 and 4, and sleeps at hour 3.