#include <bits/stdc++.h>
int max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}
int min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  int n;
  int P1, P2, P3, T1, T2;
  int l1;
  int power = 0;
  std::cin >> n >> P1 >> P2 >> P3 >> T1 >> T2;
  int temp1 = 0;
  int temp2 = 0;
  for (int i = 0; i < n; i++) {
    std::cin >> temp1;
    if (temp1 > temp2 && i > 0) {
      int diff = temp1 - temp2;
      power += max(min(diff, T1) * P1, 0) + max(min((diff - T1), T2) * P2, 0) +
               max((diff - T1 - T2) * P3, 0);
    }
    std::cin >> temp2;
    power += (temp2 - temp1) * P1;
  }
  std::cout << power;
  return 0;
}
