#include<bits/stdc++.h>
using namespace std;
int main() {
	int a,b,x,y;
	cin>>a>>b>>x>>y;
	if(a>b) {
		cout<<x+min(y,2*x)*(a-b-1);
	} else {
		cout<<min(y,2*x)*(b-a)+x;
	}
	return 0;
}
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
using namespace std;

queue<pair<pair<int, int>, int>> que;
int dist[2][110];
bool in_que[2][110];

bool in_range(int y)
{
	return y >= 1 && y <= 100;
}

int main()
{
	int a, b, x, y;
	int bu, cur, d;
	int nbu, nxt, nd;

	cin >> a >> b >> x >> y;

	memset(dist, 100, sizeof(dist));

	que.push(make_pair(make_pair(0, a), 0));
	dist[0][a] = 0;
	while (!que.empty())
	{
		bu = que.front().first.first;
		cur = que.front().first.second;
		d = que.front().second;
		que.pop();

		in_que[bu][cur] = false;

		nbu = bu;
		nxt = cur + 1;
		nd = d + y;
		if (in_range(nxt) && nd < dist[nbu][nxt])
		{
			dist[nbu][nxt] = nd;
			if (!in_que[nbu][nxt])
			{
				que.push(make_pair(make_pair(nbu, nxt), nd));
				in_que[nbu][nxt] = true;
			}
		}
		nbu = bu;
		nxt = cur - 1;
		nd = d + y;
		if (in_range(nxt) && nd < dist[nbu][nxt])
		{
			dist[nbu][nxt] = nd;
			if (!in_que[nbu][nxt])
			{
				que.push(make_pair(make_pair(nbu, nxt), nd));
				in_que[nbu][nxt] = true;
			}
		}

		nbu = !bu;
		nxt = cur;
		nd = d + x;
		if (in_range(nxt) && nd < dist[nbu][nxt])
		{
			dist[nbu][nxt] = nd;
			if (!in_que[nbu][nxt])
			{
				que.push(make_pair(make_pair(nbu, nxt), nd));
				in_que[nbu][nxt] = true;
			}
		}

		nbu = !bu;
		if (bu == 0) nxt = cur - 1;
		else nxt = cur + 1;
		nd = d + x;
		if (in_range(nxt) && nd < dist[nbu][nxt])
		{
			dist[nbu][nxt] = nd;
			if (!in_que[nbu][nxt])
			{
				que.push(make_pair(make_pair(nbu, nxt), nd));
				in_que[nbu][nxt] = true;
			}
		}
	}

	cout << dist[1][b];
}