#include <bits/stdc++.h>
using namespace std;
int n, p1, p2, p3, t1, t2, a = 0, x, l, r;
int main() {
  scanf("%d%d%d%d%d%d", &n, &p1, &p2, &p3, &t1, &t2);
  while (n--) {
    x = r;
    scanf("%d%d", &l, &r);
    a += (r - l) * p1;
    if (!x) continue;
    l -= x;
    if (l > 0) a += min(l, t1) * p1;
    l -= t1;
    if (l > 0) a += min(l, t2) * p2;
    l -= t2;
    if (l > 0) a += l * p3;
  }
  printf("%d", a);
  return 0;
}
