#include <bits/stdc++.h>

using namespace std;
#define inf 1000000000
#define unvisited -1
#define visited 1
#define eps 1e-9
#define mp make_pair
#define pb push_back
#define pi acos(-1.0)
#define uint64 unsigned long long
#define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define debug if(true)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

int main(){
	int n,k,m,i,j;
	scanf("%d %d %d",&n,&k,&m);
	int a[101];
	int sum = 0;
	for(i=0;i<n-1;i++){
		scanf("%d",&a[i]);
		sum += a[i];
	}
	int tot = n*m;
	int x = tot - sum;
	if(x < 0){
		x = 0;
	}
	if(x >= 0 && x <= k){
		printf("%d\n",x);
	}else{
		printf("-1\n");
	}
	return 0;
};
#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define fast_in_out  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ln "\n"
#define si(n) scanf("%d", &n);
#define pi(n) printf("%d\n", n);
#define sd(n) scanf("%lf", &n);
#define pd(n) printf("%.2lf\n", n);

const double EPS = (double) 1e-9;
const double pii = acos(-1);
const int mod = 1000000007;
const int N = (int) 1e5;

int main()
{
    fast_in_out;
    int a, b, x, y;
    cin >> a >> b >> x >> y ;
    int ans = x;
    if(a == b)
    {
        cout << ans << ln;
    }
    else if(a < b)
    {
        int dif = b - a;
        int cnt1 = dif * y;
        int cnt2 = dif * x * 2;
        ans += min(cnt1, cnt2);
        cout << ans << ln;
    }
    else
    {
        int dif = a - b;
        if(dif == 1)
        {
            cout << ans << ln;
        }
        else
        {
            dif--;
            int cnt1 = dif * y;
            int cnt2 = dif * x * 2;
            ans += min(cnt1, cnt2);
            cout << ans << ln;
        }
    }
}
