// Dmitry _kun_ Sayutin (2019)

#include <bits/stdc++.h>

using std::cin;
using std::cout;
using std::cerr;

using std::vector;
using std::map;
using std::array;
using std::set;
using std::string;

using std::pair;
using std::make_pair;

using std::tuple;
using std::make_tuple;
using std::get;

using std::min;
using std::abs;
using std::max;
using std::swap;

using std::unique;
using std::sort;
using std::generate;
using std::reverse;
using std::min_element;
using std::max_element;

#ifdef LOCAL
#define LASSERT(X) assert(X)
#else
#define LASSERT(X) {}
#endif

template <typename T>
T input() {
    T res;
    cin >> res;
    LASSERT(cin);
    return res;
}

template <typename IT>
void input_seq(IT b, IT e) {
    std::generate(b, e, input<typename std::remove_reference<decltype(*b)>::type>);
}

#define SZ(vec)         int((vec).size())
#define ALL(data)       data.begin(),data.end()
#define RALL(data)      data.rbegin(),data.rend()
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define TYPEMIN(type)   std::numeric_limits<type>::min()

int64_t dp[5005][5005];

int main() {
    std::iostream::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    // code here
    int n = input<int>();
    int X = input<int>();
    int Y = input<int>();

    vector<int> seq(n);

    for (int i = 0; i != n; ++i) {
        seq[i] = input<int>();
    }

    for (int i = 0; i != n + 3; ++i)
        for (int j = 0; j != n + 3; ++j)
            dp[i][j] = TYPEMAX(int64_t) / 3;

    dp[0][0] = 0;
    
    for (int prefix = 0; prefix != n; ++prefix) {
        for (int cur_max = 0; cur_max <= n; ++cur_max) {
            if (seq[prefix] >= cur_max) {
                dp[prefix + 1][seq[prefix]] = min(dp[prefix + 1][seq[prefix]], dp[prefix][cur_max]);
                dp[prefix + 1][cur_max] = min(dp[prefix + 1][cur_max], dp[prefix][cur_max] + X);
            } else {
                dp[prefix + 1][cur_max] = min(dp[prefix + 1][cur_max], dp[prefix][cur_max] + Y);
            }
        }
    }
    // for (int a = n; a >= 0; --a)
    //     for (int b = n; b >= 0; --b)
    //         if (a + b >= n)
    //             dp[a][b] = 0;
    //         else {
    //             dp[a][b] = TYPEMAX(int64_t);

    //             bool cheap_a = true, cheap_b = true;

    //             if (preca[a] < n - b)
    //                 cheap_a = false;
                
    //             // for (int i = 0; i < where[a]; ++i)
    //             //     if (seq[i] > a and seq[i] < n - b)
    //             //         cheap_a = false;

    //             if (precb[b] >= a)
    //                 cheap_b = false;
                
    //             // for (int i = where[n - 1 - b] + 1; i < n; ++i)
    //             //     if (seq[i] < n - 1 - b and seq[i] >= a)
    //             //         cheap_b = false;
                
    //             if (cheap_a)
    //                 dp[a][b] = dp[a + 1][b];
    //             else if (cheap_b)
    //                 dp[a][b] = dp[a][b + 1];
    //             else
    //                 dp[a][b] = min(dp[a + 1][b] + Y, dp[a][b + 1] + X);                    
    //         }

    int64_t ans = TYPEMAX(int64_t);
    for (int i = 0; i <= n; ++i)
        ans = min(ans, dp[n][i]);
    
    cout << ans << "\n";
    
    return 0;
}


Measured memory_bytes: 195968