#include <bits/stdc++.h>
using namespace std;
int main() {
  ;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, P1, P2, P3, T1, T2, x, y;
  cin >> n >> P1 >> P2 >> P3 >> T1 >> T2 >> x >> y;
  long long power = P1 * (y - x);
  for (int i = 1; i < n; i++) {
    cin >> x;
    if (x - y <= T1)
      power += P1 * (x - y);
    else if (x - y > T1 && x - y <= T1 + T2)
      power += P1 * T1 + P2 * (x - y - T1);
    else if (x - y > T1 + T2)
      power += P1 * T1 + P3 * (x - y - T1 - T2) + P2 * (T2);
    cin >> y;
    power += (y - x) * P1;
  }
  cout << power;
  return 0;
}
