// Arup Guha
// 11/10/2014
// Solution to 2013 November USACO Bronze Problem: Goldilocks and the N Cows

import java.util.*;
import java.io.*;

public class milktemp {

    public static void main(String[] args) throws Exception {

        Scanner stdin = new Scanner(new File("milktemp.in"));
        int n = stdin.nextInt();
        int low = stdin.nextInt();
        int med = stdin.nextInt();
        int high = stdin.nextInt();

        TreeMap<Long,Long> treelow = new TreeMap<Long,Long>();
        TreeMap<Long,Long> treehigh = new TreeMap<Long,Long>();
        TreeSet<Long> tree = new TreeSet<Long>();

        // Read in the data, storing in the appropriate TreeMaps.
        for (int i=0; i<n; i++) {

            // Read in range, make ending exclusive.
            long a = stdin.nextLong();
            long b = stdin.nextLong()+1;
            tree.add(a);
            tree.add(b);

            if (treelow.containsKey(a)) treelow.put(a,treelow.get(a)+1L);
            else                        treelow.put(a,1L);
            if (treehigh.containsKey(b)) treehigh.put(b,treehigh.get(b)+1L);
            else                        treehigh.put(b,1L);
        }

        // Score if we start at the low end of the temperature chart.
        long curScore = ((long)low)*n, bestScore = curScore;

        // Slide our valid temperature range through each temperature, in order.
        while (tree.size() > 0) {

            // Get the next critical point.
            long next = tree.pollFirst();

            // Adjust our score from the previous based on this shift.
            if (treelow.containsKey(next))
                curScore += (((long)treelow.get(next))*(med-low));
            if (treehigh.containsKey(next))
                curScore -= (((long)treehigh.get(next))*(med-high));

            // Update if this score is better.
            if (curScore > bestScore)
                bestScore = curScore;
        }

        // Write out our result.
        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("milktemp.out")));
        out.println(bestScore);
        out.close();
        stdin.close();
    }
}
