refreshed-mind-1

The average miner Sehdev took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called "Refreshed Mind".

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 ai 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 Sehdev 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 Sehdev remembers everything. The order of answers for each question and the order of questions remain unchanged, as well as the question and answers themselves.

Sehdev 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?

Input
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 ai (1 ≤ ai ≤ 109), the number of answer variants to question i.

Output
Print a single number — the minimal number of clicks needed to pass the test it the worst-case scenario. 

SAMPLE INPUT
2
1 1

SAMPLE OUTPUT
2

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
t=int(eval(input()))
x=list(map(int,input().split()))
j=0
n=sum(x)
for i in x:
	n+=j*(i-1)
	j+=1
print(n)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
n = int(input())
a = []
while len(a) != n:
	a += list(map(int,input().split()))
	
a = a[::-1]
i = 0
ctr2 = 0
while i < len(a):
	if i == 0:
		ctr = a[i]
	else:
		ctr = ctr + a[i] - 1
	ctr2+=ctr
	#print "ctr", ctr, "a[i]", a[i]
	i+=1
	
#print a
print(ctr2)