Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes *P*<sub class="lower-index">1</sub> watt per minute. *T*<sub class="lower-index">1</sub> minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to *P*<sub class="lower-index">2</sub> watt per minute. Finally, after *T*<sub class="lower-index">2</sub> minutes from the start of the screensaver, laptop switches to the "sleep" mode and consumes *P*<sub class="lower-index">3</sub> watt per minute. If Tom moves the mouse or touches the keyboard when the laptop is in the second or in the third mode, it switches to the first (normal) mode. Tom's work with the laptop can be divided into *n* time periods [*l*<sub class="lower-index">1</sub>, *r*<sub class="lower-index">1</sub>], [*l*<sub class="lower-index">2</sub>, *r*<sub class="lower-index">2</sub>], ..., [*l*<sub class="lower-index">*n*</sub>, *r*<sub class="lower-index">*n*</sub>]. During each interval Tom continuously moves the mouse and presses buttons on the keyboard. Between the periods Tom stays away from the laptop. Find out the total amount of power consumed by the laptop during the period [*l*<sub class="lower-index">1</sub>, *r*<sub class="lower-index">*n*</sub>].
The first line contains 6 integer numbers *n*, *P*<sub class="lower-index">1</sub>, *P*<sub class="lower-index">2</sub>, *P*<sub class="lower-index">3</sub>, *T*<sub class="lower-index">1</sub>, *T*<sub class="lower-index">2</sub> (1 ≤ *n* ≤ 100, 0 ≤ *P*<sub class="lower-index">1</sub>, *P*<sub class="lower-index">2</sub>, *P*<sub class="lower-index">3</sub> ≤ 100, 1 ≤ *T*<sub class="lower-index">1</sub>, *T*<sub class="lower-index">2</sub> ≤ 60). The following *n* lines contain description of Tom's work. Each *i*-th of these lines contains two space-separated integers *l*<sub class="lower-index">*i*</sub> and *r*<sub class="lower-index">*i*</sub> (0 ≤ *l*<sub class="lower-index">*i*</sub> &lt; *r*<sub class="lower-index">*i*</sub> ≤ 1440, *r*<sub class="lower-index">*i*</sub> &lt; *l*<sub class="lower-index">*i* + 1</sub> for *i* &lt; *n*), which stand for the start and the end of the *i*-th period of work.
1 3 2 1 5 10
0 10
30
2 8 4 2 5 10
20 30
50 100
570
3 15 9 95 39 19
873 989
1003 1137
1172 1436
8445
4 73 2 53 58 16
51 52
209 242
281 407
904 945
52870
5 41 20 33 43 4
46 465
598 875
967 980
1135 1151
1194 1245
46995
6 88 28 100 53 36
440 445
525 614
644 844
1238 1261
1305 1307
1425 1434
85540
7 46 61 55 28 59
24 26
31 61
66 133
161 612
741 746
771 849
1345 1357
67147
8 83 18 30 28 5
196 249
313 544
585 630
718 843
1040 1194
1207 1246
1268 1370
1414 1422
85876
9 31 65 27 53 54
164 176
194 210
485 538
617 690
875 886
888 902
955 957
1020 1200
1205 1282
38570
30 3 1 58 44 7
11 13
14 32
37 50
70 74
101 106
113 129
184 195
197 205
213 228
370 394
443 446
457 460
461 492
499 585
602 627
709 776
812 818
859 864
910 913
918 964
1000 1010
1051 1056
1063 1075
1106 1145
1152 1189
1211 1212
1251 1259
1272 1375
1412 1417
1430 1431
11134
30 42 3 76 28 26
38 44
55 66
80 81
84 283
298 314
331 345
491 531
569 579
597 606
612 617
623 701
723 740
747 752
766 791
801 827
842 846
853 891
915 934
945 949
955 964
991 1026
1051 1059
1067 1179
1181 1191
1214 1226
1228 1233
1294 1306
1321 1340
1371 1374
1375 1424
59043
30 46 5 93 20 46
12 34
40 41
54 58
100 121
162 182
220 349
358 383
390 398
401 403
408 409
431 444
466 470
471 535
556 568
641 671
699 709
767 777
786 859
862 885
912 978
985 997
1013 1017
1032 1038
1047 1048
1062 1080
1094 1097
1102 1113
1122 1181
1239 1280
1320 1369
53608
30 50 74 77 4 57
17 23
24 61
67 68
79 87
93 101
104 123
150 192
375 377
398 414
461 566
600 633
642 646
657 701
771 808
812 819
823 826
827 833
862 875
880 891
919 920
928 959
970 1038
1057 1072
1074 1130
1165 1169
1171 1230
1265 1276
1279 1302
1313 1353
1354 1438
84067
30 54 76 95 48 16
9 11
23 97
112 116
126 185
214 223
224 271
278 282
283 348
359 368
373 376
452 463
488 512
532 552
646 665
681 685
699 718
735 736
750 777
791 810
828 838
841 858
874 1079
1136 1171
1197 1203
1210 1219
1230 1248
1280 1292
1324 1374
1397 1435
1438 1439
79844
30 58 78 12 41 28
20 26
27 31
35 36
38 99
103 104
106 112
133 143
181 246
248 251
265 323
350 357
378 426
430 443
466 476
510 515
517 540
542 554
562 603
664 810
819 823
826 845
869 895
921 973
1002 1023
1102 1136
1143 1148
1155 1288
1316 1388
1394 1403
1434 1437
82686
30 62 80 97 25 47
19 20
43 75
185 188
199 242
252 258
277 310
316 322
336 357
398 399
404 436
443 520
549 617
637 649
679 694
705 715
725 730
731 756
768 793
806 833
834 967
1003 1079
1088 1097
1100 1104
1108 1121
1127 1164
1240 1263
1274 1307
1367 1407
1419 1425
1433 1437
92356
30 100 48 14 9 7
26 55
75 107
145 146
158 167
197 199
201 213
222 238
257 265
271 338
357 439
454 462
463 562
633 660
670 691
696 829
844 864
880 888
891 894
895 900
950 973
1004 1007
1018 1021
1045 1049
1062 1073
1138 1184
1240 1272
1278 1315
1403 1410
1412 1418
1426 1434
107490
30 3 50 32 1 18
46 60
66 94
99 141
162 239
309 334
400 550
594 630
659 663
664 701
735 736
741 755
756 801
823 854
865 915
937 964
984 986
990 1007
1008 1031
1052 1064
1073 1080
1190 1191
1192 1254
1265 1266
1272 1273
1274 1277
1284 1302
1308 1312
1358 1383
1388 1389
1390 1401
25258
30 7 52 49 46 37
2 73
129 130
131 140
143 150
187 190
217 238
248 271
375 426
465 470
475 503
506 541
569 571
578 585
680 683
690 738
742 761
868 877
890 892
904 915
935 961
1076 1100
1103 1114
1232 1244
1246 1247
1257 1261
1271 1276
1280 1298
1346 1360
1373 1382
1407 1419
23992
n,p1,p2,p3,t1,t2=map(int,input().split())
def interval(x):
    if x<=t1:
        return x*p1
    elif x<=t1+t2:
        return x*p2+t1*(p1-p2)
    else:
        return x*p3+t2*(p2-p3)+t1*(p1-p3)
e1,e2=0,0
for i in range(n):
    a,b=map(int,input().split())
    e1+=(b-a)*p1
    if i>0:
        e2+=interval(a-b0)
    b0=b
print(e1+e2)