The average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Testing Pants for Sadness".

The test consists of *n* questions; the questions are to be answered strictly in the order in which they are given, from question 1 to question *n*. Question *i* contains *a*<sub class="lower-index">*i*</sub> answer variants, exactly one of them is correct. 

A click is regarded as selecting any answer in any question. The goal is to select the correct answer for each of the *n* questions. If Vaganych selects a wrong answer for some question, then all selected answers become unselected and the test starts from the very beginning, from question 1 again. But Vaganych remembers everything. The order of answers for each question and the order of questions remain unchanged, as well as the question and answers themselves.

Vaganych is very smart and his memory is superb, yet he is unbelievably unlucky and knows nothing whatsoever about the test's theme. How many clicks will he have to perform in the worst case?
The first line contains a positive integer *n* (1 ≤ *n* ≤ 100). It is the number of questions in the test. The second line contains space-separated *n* positive integers *a*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>), the number of answer variants to question *i*.
2
1 1
2
2
2 2
5
1
10
10
3
2 4 1
10
4
5 5 3 1
22
2
1000000000 1000000000
2999999999
10
5 7 8 1 10 3 6 4 10 6
294
100
5 7 5 3 5 4 6 5 3 6 4 6 6 2 1 9 6 5 3 8 4 10 1 9 1 3 7 6 5 5 8 8 7 7 8 9 2 10 3 5 4 2 6 10 2 6 9 6 1 9 3 7 7 8 3 9 9 5 10 10 3 10 7 8 3 9 8 3 2 4 10 2 1 1 7 3 9 10 4 6 9 8 2 1 4 10 1 10 6 8 7 5 3 3 6 2 7 10 3 8
24212
100
96 23 25 62 34 30 85 15 26 61 59 87 34 99 60 41 52 73 63 84 50 89 42 29 87 99 19 94 84 43 82 90 41 100 60 61 99 49 26 3 97 5 24 34 51 59 69 61 11 41 72 60 33 36 18 29 82 53 18 80 52 98 38 32 56 95 55 79 32 80 37 64 45 13 62 80 70 29 1 58 88 24 79 68 41 80 12 72 52 39 64 19 54 56 70 58 19 3 83 62
261115
100
883 82 79 535 478 824 700 593 262 385 403 183 176 386 126 648 710 516 922 97 800 728 372 9 954 911 975 526 476 3 74 459 471 174 295 831 698 21 927 698 580 856 712 430 5 473 592 40 301 230 763 266 38 213 393 70 333 779 811 249 130 456 763 657 578 699 939 660 898 918 438 855 892 85 35 232 54 593 849 777 917 979 796 322 473 887 284 105 522 415 86 480 80 592 516 227 680 574 488 644
2519223
100
6659 5574 5804 7566 7431 1431 3871 6703 200 300 3523 3580 8500 2312 4812 3149 3324 5846 8965 5758 5831 1341 7733 4477 355 3024 2941 9938 1494 16 1038 8262 9938 9230 5192 8113 7575 7696 5566 2884 8659 1951 1253 6480 3877 3707 5482 3825 5359 44 3219 3258 1785 5478 4525 5950 2417 1991 8885 4264 8769 2961 7107 8904 5097 2319 5713 8811 9723 8677 2153 3237 7174 9528 9260 7390 3050 6823 6239 5222 4602 933 7823 4198 8304 244 5845 3189 4490 3216 7877 6323 1938 4597 880 1206 1691 1405 4122 5950
24496504
50
515844718 503470143 928669067 209884122 322869098 241621928 844696197 105586164 552680307 968792756 135928721 842094825 298782438 829020472 791637138 285482545 811025527 428952878 887796419 11883658 546401594 6272027 100292274 308219869 372132044 955814846 644008184 521195760 919389466 215065725 687764134 655750167 181397022 404292682 643251185 776299412 741398345 865144798 369796727 673902099 124966684 35796775 794385099 594562033 550366869 868093561 695094388 580789105 755076935 198783899
685659563557
10
12528238 329065023 620046219 303914458 356423530 751571368 72944261 883971060 123105651 868129460
27409624352
1
84355694
84355694
2
885992042 510468669
1906929379
100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
100
100
2 1 2 2 2 2 1 2 2 1 2 2 2 1 2 1 2 2 1 2 2 2 2 2 2 1 2 1 1 2 1 1 2 1 2 1 1 1 2 2 2 2 2 1 2 2 2 2 1 1 1 1 1 2 2 1 1 1 2 2 1 1 2 1 1 2 2 2 2 1 2 2 2 1 2 1 2 2 1 2 1 1 1 2 2 1 2 1 2 1 1 1 2 1 2 2 2 1 1 1
2686
100
1 3 2 1 1 2 1 3 2 2 3 1 1 1 2 2 1 3 3 1 1 2 2 3 2 1 3 1 3 2 1 1 3 3 2 1 2 2 2 3 2 2 3 2 2 3 2 1 3 1 1 2 1 3 2 2 1 1 1 1 1 1 3 1 2 3 1 1 1 1 1 2 3 3 1 1 1 1 2 3 3 1 3 2 2 3 2 1 3 2 2 3 1 1 3 2 3 2 3 1
4667
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(n):
    s += a[i]
    if a[i] != 1:
        s += i
print(s)