// #include #include using namespace std; using namespace atcoder; using ll = long long; #define rep(i, n) for (int i=0; i<(int)(n); ++(i)) #define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i)) #define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i)) #define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i)) #define all(x) (x).begin(), (x).end() const ll LINF = (ll)(1e18); int main() { int n, k, x; cin >> n >> k >> x; vector a(n); rep(i, n) cin >> a[i]; vector> dp(2, vector(2, LINF)); dp[0][0] = 0; rep(i, n) { dp[(i+1)%2][0] = min(dp[i%2][0], dp[i%2][1]) + a[i]; dp[(i+1)%2][1] = min(dp[i%2][0]+x+k, dp[i%2][1]+k); } ll res = min(dp[n%2][0], dp[n%2][1]); cout << res << endl; return 0; }