Byteasar keeps an account at the Byteotian Bit Bank (BBB for short). The account began with p bythalers and ended with q bythalers. Every transaction was either a deposit or a withdrawal of exactly one bythaler, and the balance was never negative at any moment.
A teller printed a statement for the account: a strip of paper with a sequence of n symbols, where + marks a deposit of one bythaler and - marks a withdrawal of one bythaler. It later turned out that some symbols had been entered incorrectly. The teller cannot print a new statement and must fix the printed one in place. The corrected statement need not match what really happened; it only has to satisfy both of these conditions:
The teller can make two kinds of edits:
+ becomes -, or - becomes +) in x seconds;For example, with p=2 and q=3 the statement --++-+-++-+-+ is already correct. The statement ---++++++ is not: after the third transaction the balance would be negative, and the final balance would be 5 instead of 3. It can be repaired by flipping the second-to-last symbol and then moving the last symbol to the front.
Determine the minimum number of seconds the teller needs so that the statement becomes correct: the initial and final balances agree and the balance is never negative.
The first line contains five integers n, p, q, x, and y (1≤n≤106, 0≤p,q≤106, 1≤x,y≤103), separated by single spaces: the number of transactions, the initial balance, the final balance, the time in seconds needed for one flip, and the time in seconds needed to move the last symbol to the front. The second line contains a string of n characters, each + or -, with no spaces between them.
Print a single integer: the minimum number of seconds needed to make the statement correct. If no edit is needed, print 0. A valid sequence of edits is guaranteed to exist.