BBB

No attempts yetTime limit1sMemory limit128 MB

Problem

Byteasar keeps an account at the Byteotian Bit Bank (BBB for short). The account began with pp bythalers and ended with qq 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 nn 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 final balance is consistent with the initial balance pp and the sequence of transactions on the statement (that is, it equals qq);
  • reading the transactions from left to right, the balance is never negative.

The teller can make two kinds of edits:

  • flip any single chosen symbol to its opposite (+ becomes -, or - becomes +) in xx seconds;
  • take the last symbol of the statement and move it to the front in yy seconds.

For example, with p=2p = 2 and q=3q = 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 55 instead of 33. 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.

Input

The first line contains five integers nn, pp, qq, xx, and yy (1n1061 \le n \le 10^6, 0p,q1060 \le p, q \le 10^6, 1x,y1031 \le x, y \le 10^3), 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 nn characters, each + or -, with no spaces between them.

Output

Print a single integer: the minimum number of seconds needed to make the statement correct. If no edit is needed, print 00. A valid sequence of edits is guaranteed to exist.