#include<bits/stdc++.h>
#define ll long long
#define sti string
#define bit(n,i) ((n>>i)&1)
#define itachi ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define maxn 500005
#define int long long
#define fi first
#define se second
using namespace std;

int n,x,y,z;
const int INF = 4e18;

signed main(){
    itachi
    cin>>n>>x>>y>>z;
    int sum = 0;
    priority_queue<int,vector<int>,greater<int>> thua,thieu;
    for(int i=1;i<=n;i++) {
        int a,b;
        cin>>a>>b;
        int cur_cost = i * z;
        if(a > b){
            for(int zz=0;zz< a- b;zz++){
                sum += y;
                int change=INF,top;
                if(!thieu.empty()){
                    top = thieu.top();
                    change = cur_cost + thieu.top() - y;
                }
                if(change < 0 ){
                    sum += change;
                    thieu.pop();
                    thua.push(-cur_cost - cur_cost - top);
                }
                else thua.push(-cur_cost - y);
            }
        }
        else if(a<b) {
            for(int zz=0;zz<b-a;zz++){
                sum += x;
                int change=INF,top;
                if(!thua.empty()){
                    top = thua.top();
                    change = cur_cost + thua.top() - x;
                }
                if(change < 0 ){
                    sum += change;
                    thua.pop();
                    thieu.push(-cur_cost - cur_cost - top);
                }
                else thieu.push(-cur_cost - x);
            }
        }
    }
    cout<<sum;
    return 0;
}
