Linear Kingdom has exactly one tram line. It has *n* stops, numbered from 1 to *n* in the order of tram's movement. At the *i*-th stop *a*<sub class="lower-index">*i*</sub> passengers exit the tram, while *b*<sub class="lower-index">*i*</sub> passengers enter it. The tram is empty before it arrives at the first stop. Also, when the tram arrives at the last stop, all passengers exit so that it becomes empty.

Your task is to calculate the tram's minimum capacity such that the number of people inside the tram at any time never exceeds this capacity. Note that at each stop all exiting passengers exit before any entering passenger enters the tram.
The first line contains a single number *n* (2 ≤ *n* ≤ 1000) — the number of the tram's stops. 

Then *n* lines follow, each contains two integers *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ 1000) — the number of passengers that exits the tram at the *i*-th stop, and the number of passengers that enter the tram at the *i*-th stop. The stops are given from the first to the last stop in the order of tram's movement.
 -  The number of people who exit at a given stop does not exceed the total number of people in the tram immediately before it arrives at the stop. More formally, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/eb1e20fd58cc4373d8f42eb7e743d3ea232d1a19.png" style="max-width: 100.0%;max-height: 100.0%;"/>. This particularly means that *a*<sub class="lower-index">1</sub> = 0. -  At the last stop, all the passengers exit the tram and it becomes empty. More formally, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/8cbe43ecd252bf7d670f9a3956cbe50263d2f09b.png" style="max-width: 100.0%;max-height: 100.0%;"/>. -  No passenger will enter the train at the last stop. That is, *b*<sub class="lower-index">*n*</sub> = 0.
4
0 3
2 5
4 2
4 0
6
5
0 4
4 6
6 5
5 4
4 0
6
10
0 5
1 7
10 8
5 3
0 5
3 3
8 8
0 6
10 1
9 0
18
3
0 1
1 1
1 0
1
4
0 1
0 1
1 0
1 0
2
3
0 0
0 0
0 0
0
3
0 1000
1000 1000
1000 0
1000
5
0 73
73 189
189 766
766 0
0 0
766
5
0 0
0 0
0 0
0 1
1 0
1
5
0 917
917 923
904 992
1000 0
11 0
1011
5
0 1
1 2
2 1
1 2
2 0
2
5
0 0
0 0
0 0
0 0
0 0
0
20
0 7
2 1
2 2
5 7
2 6
6 10
2 4
0 4
7 4
8 0
10 6
2 1
6 1
1 7
0 3
8 7
6 3
6 3
1 1
3 0
22
5
0 1000
1000 1000
1000 1000
1000 1000
1000 0
1000
10
0 592
258 598
389 203
249 836
196 635
478 482
994 987
1000 0
769 0
0 0
1776
10
0 1
1 0
0 0
0 0
0 0
0 1
1 1
0 1
1 0
1 0
2
10
0 926
926 938
938 931
931 964
937 989
983 936
908 949
997 932
945 988
988 0
1016
10
0 1
1 2
1 2
2 2
2 2
2 2
1 1
1 1
2 1
2 0
3
10
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0
10
0 1000
1000 1000
1000 1000
1000 1000
1000 1000
1000 1000
1000 1000
1000 1000
1000 1000
1000 0
1000
50
0 332
332 268
268 56
56 711
420 180
160 834
149 341
373 777
763 93
994 407
86 803
700 132
471 608
429 467
75 5
638 305
405 853
316 478
643 163
18 131
648 241
241 766
316 847
640 380
923 759
789 41
125 421
421 9
9 388
388 829
408 108
462 856
816 411
518 688
290 7
405 912
397 772
396 652
394 146
27 648
462 617
514 433
780 35
710 705
460 390
194 508
643 56
172 469
1000 0
194 0
2071
50
0 0
0 1
1 1
0 1
0 0
1 0
0 0
1 0
0 0
0 0
0 0
0 0
0 1
0 0
0 0
0 1
1 0
0 1
0 0
1 1
1 0
0 1
0 0
1 1
0 1
1 0
1 1
1 0
0 0
1 1
1 0
0 1
0 0
0 1
1 1
1 1
1 1
1 0
1 1
1 0
0 1
1 0
0 0
0 1
1 1
1 1
0 1
0 0
1 0
1 0
3
50
0 926
926 971
915 980
920 965
954 944
928 952
955 980
916 980
906 935
944 913
905 923
912 922
965 934
912 900
946 930
931 983
979 905
925 969
924 926
910 914
921 977
934 979
962 986
942 909
976 903
982 982
991 941
954 929
902 980
947 983
919 924
917 943
916 905
907 913
964 977
984 904
905 999
950 970
986 906
993 970
960 994
963 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1 1
1 2
2 1
2 2
1 1
2 1
1 1
2 1
1 1
1 2
2 2
2 2
1 1
2 2
1 2
2 1
2 1
1 1
1 1
1 2
1 2
1 1
1 1
2 1
1 2
1 2
2 1
2 2
2 2
2 2
2 1
2 2
1 1
1 2
1 2
1 1
2 2
2 2
1 1
2 1
1 1
1 2
1 2
1 2
1 1
1 1
2 2
1 2
2 1
2 1
2 1
1 2
1 2
1 1
2 2
1 2
2 0
2 0
2 0
1 0
7
100
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0
2
0 1
1 0
1
2
0 900
900 0
900
2
0 1
1 0
1
2
0 0
0 0
0
2
0 1000
1000 0
1000
3
0 802
175 188
815 0
815
3
0 910
910 976
976 0
976
3
0 2
2 1
1 0
2
n = int(input())
t = 0
c = 0
for i in range(n):
  a, b = map(int, input().split())
  t -= a
  t += b
  if t > c:
    c = t
  else:
    continue
print(c)