P12396 「FAOI-R9」Ordinary People's Layup
Background
Qingfeng stared at the white line on the backboard.
When the basketball hit the edge after being shot, He tightened his heart for the ball landed on the rim of the basket and he felt a slight sense of relief.
However, after bouncing up the basketball popped out of the backboard.
He rushed toward the direction where the ball fell watching as it was about to fly toward the sideline...
Qingfeng can still remember those time a year ago when he was preparing for the high school entrance examination so far.
Description
The basketball rules for the high school entrance examination in City B are as follows:
- A full set of movements for examinees is defined as dribbling to the basket, a successful layup, and returning to the three point line, with these three actions performed consecutively in sequence.
- The criteria for determining the success of a set of movements are as follows: examinees must remain under the basket for a continuous period of time, during which only successful or failed shots can occur.A set is considered successful if a shot is made during this period. Specially, if (at least) three consecutive shots fail, it is also deemed successful.
- Dribbling to the basket and returning are respectively the displacement from the three point line to under the basket and its reverse displacement.
- The candidate is initially on the three-point line and needs to complete at least four complete sets of actions and return to the three-point line (meaning that even if all four sets of actions have been completed, the exam cannot be ended if Qingfeng is not on the three-point line). The total time for all actions is calculated. The score will be full if the time is within 35 seconds, and it will be zero if the time is outside 45 seconds.
Qingfeng can perform the following actions in this execrise:
- If he is on the three point line, he can use $a$ seconds and dribble the ball to the basket,whose operation symbol is ```G```. After this action, he is under the basket.
- If he is under the basket, he can use $a$ seconds and dribble the ball to the three point line,whose operation symbol is ```B```. After this action, he is on the three point line.
- If he is under the basket, he can use $b$ seconds and aim for the layup ,whose operation symbol is ```A```. Then, the basketball will definitely be thrown in. Or he can use $c$ seconds and casully layup,whose operation symbol is ```W```. Then, the basketball won't be thrown in.

(Exam Rules Diagram)
Now a sequence of Qingfeng's operation sequence is given and it is ensured to be legal. Please help Qingfeng plan the remaining operations so that he can complete the basketball exam in the shortest total time (including the operations that have already been performed).
Input Format
The first line of input contains three integers $a,b,c$, which denotes the time each operation cost.
The second line contains a string $S$, which denotes the operation sequence.
Output Format
The only line contains an integer representing the shortest total time.
Explanation/Hint
#### Sample Description
For the first test case: After the given operation sequence, the subsequent operations to be performed are: ```ABGAB```.
For the last full set of movements: Obviously, making a layup successfully in one attempt is better than trying three times.
For the second test case: The movements were completed, but Qingfeng ran back under the basket, the correct action is to return.
For the third test case: Qingfeng needs repeat ```GWWWB``` four times; obviously, three attempts are better than making a layup successfully in one attempt.
For the fourth test case:
For incomplete full movements, obviously, trying twice is better than making a layup successfully in one attempt.
For unperformed full movements, obviously, making a layup successfully in one attempt is better than trying three times.
For the fifth test case: Obviously, for incomplete and unperformed full movements, trying at least twice or three times is not better than making a layup successfully in one attempt.
For the sixth test case: For incomplete and unperformed full movements, trying twice or three times is better than making a layup successfully in one attempt.
#### Constraints
**The score of each test case is equal.**
For test case $1$, it is guaranteed that the exam can be ended directly by performing the given sequence of operations.
For test case $2\sim 5$, it is guaranteed that $b=c$.
For test case $6\sim 10$, there are no additional constraints.
For all test cases, it is guaranteed that $1\le |S|\le 100$, $S_i\in\{\texttt{G},\texttt{B},\texttt{A},\texttt{W}\}$, $1\le a,b,c \le 10^7$, $b\ge c$, and $S$ is legal.