#include <bits/stdc++.h>
/*
    the problem is:
        insert p[l] after position r cost A if l < r
        else cost B
    does the order of operators matter?
    dp[i][last] -> sort all 1 2 3 ... i and the last time move the current permultation is last
    how to insert i+1:
        use cost A or B to move i+1 after i
        use i * (cost B or A) to move (1...i) before i+1
*/
using namespace std;
#ifdef LDT
const int maxn = 50;
#else
const int maxn = 5005;
#endif
int n, A, B;
int p[maxn];
int pos[maxn];
long long f[maxn][maxn];
int best[maxn][maxn];
int s[maxn][maxn];
void optimize(long long &x, long long a) {
    if (x > a) x = a;
}
int main() {
#ifdef LDT
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> A >> B;
    for (int i = 1; i <= n; ++i)
        cin >> p[i];
    for (int i = 1; i <= n; ++i)
        pos[p[i]] = i;
    for (int i = 1; i <= n; ++i) {
        best[i][i] = p[i];
        for (int j = i + 1; j <= n; ++j)
            best[i][j] = max(best[i][j - 1], p[j]);
        s[i][0] = 0;
        for (int j = 1; j <= n; ++j)
            s[i][j] = s[i][j - 1] + (p[j] > i);
    }
    memset(f, 63, sizeof(f));
    f[1][pos[1]] = 0;
    for (int i = 1; i <= n; ++i) 
        for (int l = 1; l <= n; ++l) {
            int nxt = pos[i + 1];
            if (l < nxt && best[l][nxt] <= i + 1) {
                optimize(f[i + 1][l], f[i][l]);
                optimize(f[i + 1][nxt], f[i][l]);
            }
            else if (nxt < l) {
                //move i + 1 after (1..i)
                optimize(f[i + 1][l], f[i][l] + A);
                //move (1..i) before i + 1
                optimize(f[i + 1][nxt], f[i][l] + 1ll * i *  B);

            }
            else {
                optimize(f[i + 1][l], f[i][l] + 
                    min(1ll * B, 1ll * A * (s[i][nxt - 1] - s[i][l])));
                
                optimize(f[i + 1][nxt], f[i][l] + 1ll * i *  A);
            }
        }
    cout << *min_element(f[n] + 1, f[n] + 1 + n);
    return 0;
}