 #include <bits/stdc++.h>
 #define repi(i, a, b) for (int i = (int)(a) ; i < (int)(b) ; i++)
 #define rep(i, n) repi(i, 0, n)
 #define SZ(x) ((int)(x).size())
 typedef long long ll;
 typedef unsigned long long ull;
 typedef unsigned int uint;
 using namespace std;
 using P = pair<int, int>;
 struct Vec{
         double x, y;
 };
 template<class T> inline bool chmin(T& a, T b) {
         if (a > b) {
             a = b;
             return true;
         }
         return false;
 }
 template<class T> inline bool chmax(T& a, T b) {
         if (a < b) {
             a = b;
             return true;
         }
          return false;
 }

 double norm(int x1, int x2, int y1, int y2){
     return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2- y1);
 }

 int main()
 {
         cin.tie(nullptr);
         ios_base::sync_with_stdio(false);
         // cout << fixed << setprecision(15);
         int n;
         cin >> n;
         vector<vector<int>> xy(n, vector<int>(2));
         rep(i,n) cin >> xy[i][0] >> xy[i][1];
         rep(i, n) repi(k, i+1, n) repi(l, k + 1, n){
             int dx1, dx2, dy1, dy2;
             dx1 = xy[i][0] - xy[k][0];
             dy1 = xy[i][1] - xy[k][1];
             dx2 = xy[l][0] - xy[k][0];
             dy2 = xy[l][1] - xy[k][1];
             if (dx2 * dy1 == dx1 * dy2) {
                 cout << "Yes" << endl;
                 return 0;
             }
         }
         cout << "No" << endl;
         return 0;
 }
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define loop(i, a, n) for(int i = (a); i < (n); i++)
#define all(x) x.begin(), x.end()
#ifdef _DEBUG
#define disp(x) cout << #x << " : " << x << endl
#else
#define disp(x)
#endif
using namespace std;
using ll = int64_t;

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

    if(a > b) {
        int d = a - b;
        cout << min((d - 1)*y + x, (2*d - 1)*x) << endl;
    } else if(a < b) {
        int d = b - a;
        cout << min(d*y + x, (2*d + 1)*x) << endl;
    } else {
        cout << x << endl;
    }

    return 0;
}
