#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <iostream>

using namespace std;

int main() {
    int a, b, x, y;
    cin >> a >> b >> x >> y;

    int diff = a > b ? a - b - 1 : b - a;

    cout << x + min(2 * x, y) * diff << endl;
}

#include <bits/stdc++.h>
using namespace std;

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)((n)-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
template<typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2>& p){
    return o << "(" << p.first << ", " << p.second << ")";
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}
template <typename ... Args>
string format(const std::string& fmt, Args ... args ){
   size_t len = std::snprintf(nullptr, 0, fmt.c_str(), args ... );
   vector<char> buf(len + 1);
   snprintf(&buf[0], len + 1, fmt.c_str(), args ... );
   return string(&buf[0], &buf[0] + len);
}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

vector<vector<pii>> g(310);
vi dijk(int s){
    vi d(310, INF);
    d[s] = 0;
    priority_queue<pii, vector<pii>, greater<pii>> Q;
    Q.emplace(0,s);
    while(!Q.empty()){
        int c = Q.top().fi;
        int v = Q.top().se;
        Q.pop();
        if(c > d[v]) continue;
        for(auto p : g[v]){
            int u = p.fi;
            int uc = p.se;
            if(d[u] > d[v] + uc){
                d[u] = d[v] + uc;
                Q.emplace(d[u], u);
            }
        }
    }
    return d;
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int M = 200;
    int a,b,x,y;
    cin >> a >> b >> x >> y;
    a -= 1; b += M-1;
    rep(i,100){
        g[i].emplace_back(i+M, x);
        g[i+M].emplace_back(i, x);
        g[i+1].emplace_back(i+M, x);
        g[i+M].emplace_back(i+1, x);
        g[i].emplace_back(i+1,y);
        g[i+1].emplace_back(i,y);
        g[i+M].emplace_back(i+M+1,y);
        g[i+M+1].emplace_back(i+M,y);
    }
    vi d = dijk(a);
    cout << d[b] << endl;
    return 0;
}