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

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. 

Please do not use the %lld specificator to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.

Examples

Input

2
1 1


Output

2

Input

2
2 2


Output

5

Input

1
10


Output

10

Note

Note to the second sample. In the worst-case scenario you will need five clicks: 

  * the first click selects the first variant to the first question, this answer turns out to be wrong. 
  * the second click selects the second variant to the first question, it proves correct and we move on to the second question; 
  * the third click selects the first variant to the second question, it is wrong and we go back to question 1; 
  * the fourth click selects the second variant to the first question, it proves as correct as it was and we move on to the second question; 
  * the fifth click selects the second variant to the second question, it proves correct, the test is finished.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Implementation

Greedy algorithms


Solutions:
import sys, math
s = int(input())
arr = list(map(int, input().split(' ')))
m = 0
for i in range(0, s):
	m += (arr[i] - 1) * (i + 1) + 1
print(m)


n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(len(a)):
	s += (a[i] - 1) * (i + 1) + 1
print(s)


r = input
r()
print(sum((int(v) * i - i + 1 for (i, v) in enumerate(r().split(), 1))))


clicks = 0
nums = int(input())
array = list(map(int, input().split(' ')))
for i in range(1, nums + 1):
	clicks += (array[i - 1] - 1) * i + 1
print(clicks)


n = int(input())
arr = list(map(int, input().split(' ')))
ans = 0
for i in range(1, n + 1):
	op = arr[i - 1]
	ans += 1 + (op - 1) * i
print(ans)


from sys import *
input = stdin.readline
listInput = lambda : list(map(int, input().strip().split()))
lineInput = lambda : map(int, input().strip().split())
sJoin = lambda a, sep: f'{sep}'.join(a)
arrJoin = lambda a, sep: f'{sep}'.join(map(str, a))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, int(math.sqrt(n) + 1), 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def main():
	n = int(input())
	arr = listInput()
	c = arr[0]
	for i in range(1, n):
		c += arr[i] + (arr[i] - 1) * i
	print(c)
main()


n = int(input())
l1 = list(map(int, input().split()))
c = l1[0]
for i in range(1, n):
	c = c + l1[i] + (l1[i] - 1) * i
print(c)


n = int(input())
l = list(map(int, input().split()))
s = 0
for i in range(len(l)):
	if l[i] == 1:
		s = s + 1
	else:
		s = s + l[i] + (l[i] - 1) * i
print(s)


n = int(input())
l = list(map(int, input().split()))
ans = l[0]
for i in range(1, n):
	ans += l[i] + (l[i] - 1) * i
print(ans)


num_questions = int(input())
num_answers = [int(i) for i in input().split()]
tot = 0
for i in range(len(num_answers)):
	tot += (i + 1) * num_answers[i] - i
print(tot)


import sys
import math
import bisect

class PrefixSum:
	n = None
	A = None

	def __init__(self, A):
		self.n = len(A)
		self.A = A.copy()
		for i in range(1, self.n):
			self.A[i] += self.A[i - 1]

	def query_prefix_sum_value(self, x):
		return self.A[x]

	def query_sum_value(self, x, y):
		ans = self.query_prefix_sum_value(y)
		if x:
			ans -= self.query_prefix_sum_value(x - 1)
		return ans

	def unwind(self):
		A = [0] * self.n
		for i in range(self.n):
			A[i] = self.query_sum_value(i, i)
		return A

def solve(A):
	n = len(A)
	prefix = PrefixSum(A)
	B = [0] * n
	for i in range(n):
		if i == 0:
			B[i] = A[i]
		elif A[i] == 1:
			B[i] = B[i - 1] + 1
		else:
			B[i] = B[i - 1] + 1 + (i + 1) * (A[i] - 1)
	return B[-1]

def main():
	n = int(input())
	A = list(map(int, input().split()))
	ans = solve(A)
	print(ans)
main()


n = int(input())
a = list(map(int, input().split()))
ans = 0
for (i, j) in enumerate(a):
	ans += (j - 1) * (i + 1) + 1
print(ans)


n = int(input())
l = list(map(int, input().split()))
i = 0
x = 0
for j in range(n):
	x = x + (l[j] - 1) * (j + 1) + 1
print(x)


n = int(input())
a = list(map(int, input().split()))
s = 0
for x in range(n):
	s += (a[x] - 1) * (x + 1) + 1
print(s)


N = int(input())
A = list((int(i) for i in input().split()))
total = 0
for i in range(N):
	clicksToReach = i
	if A[i] > 1:
		total += A[i] - 1 + clicksToReach * (A[i] - 1)
total += N
print(total)


n = int(input().rstrip())
a = map(int, input().rstrip().split())
res = 0
for (i, v) in enumerate(a):
	res += v + (v - 1) * i
print(res)


def trausers(lst):
	result = 0
	for i in range(len(lst)):
		result += (lst[i] - 1) * (i + 1) + 1
	return result
n = int(input())
a = [int(j) for j in input().split()]
print(trausers(a))


import itertools as it
(n, a) = (int(input()), list(map(int, input().split())))
b = list(it.accumulate([c - 1 for c in a[::-1]]))[::-1]
print(sum([a[i] + b[i + 1] for i in range(n - 1)]) + a[-1])


from sys import *
from bisect import *
from collections import *
from itertools import *
from fractions import *
from datetime import *
Input = []

def Out(x):
	stdout.write(str(x) + '\n')

def In():
	return stdin.readline().strip()

def inputGrab():
	for line in stdin:
		Input.extend(map(str, line.strip().split()))

def cal(x, y):
	if x == 1:
		return 1
	if y == 1:
		return x
	return y * (x - 1) + 1

def main():
	n = int(In())
	l = list(map(int, In().split()))
	ans = 0
	for (i, x) in enumerate(l, 1):
		ans = ans + cal(x, i)
	print(ans)
main()


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
ans = 0
answered = 0
for choices in a:
	ans += (choices - 1) * (answered + 1) + 1
	answered += 1
print(ans)


class CodeforcesTask103ASolution:

	def __init__(self):
		self.result = ''
		self.quest_num = 0
		self.questions = []

	def read_input(self):
		self.quest_num = int(input())
		self.questions = [int(x) for x in input().split(' ')]

	def process_task(self):
		clicks = 0
		position = 1
		while not position > self.quest_num:
			if self.questions[position - 1] > 1:
				clicks += (self.questions[position - 1] - 1) * position + 1
				position += 1
			else:
				clicks += 1
				position += 1
		self.result = str(clicks)

	def get_result(self):
		return self.result
Solution = CodeforcesTask103ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


from sys import stdin
__author__ = 'artyom'
n = int(stdin.readline().strip())
count = 0
a = list(map(int, stdin.readline().strip().split()))
for i in range(n):
	v = a[i]
	count += (v - 1) * i
	count += v
print(count)


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	l = list(map(int, input().split()))
	ans = 0
	for (i, item) in enumerate(l):
		if item == 1:
			ans += 1
		else:
			ans += (item - 1) * (i + 1) + 1
	print(ans)

def nouse0():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse1():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse2():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def nouse3():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse4():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse5():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
main()


input()
s = 0
for (x, i) in enumerate(input().split(), 1):
	s += (int(i) - 1) * x + 1
print(s)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = ii()
	l = li()
	ans = 0
	for i in range(n):
		ans += l[i] + (l[i] - 1) * i
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
l = [int(x) for x in input().split()]
sum = l[0]
for i in range(1, n):
	sum += 1 + (l[i] - 1) * (i + 1)
print(sum)


n = int(input())
a_arr = input().split()
s_click = 0
for q_number in range(1, n + 1):
	s_click = s_click + q_number * int(a_arr[q_number - 1]) - q_number + 1
print(s_click)


n = int(input())
arr = [0] * n
b = input().split()
for i in range(n):
	arr[i] = int(b[i])
tot = 0
for i in range(n):
	tot += arr[i]
	current = 0
	if i > 0:
		current = (i - 0) * (arr[i] - 1)
	tot += current
print(tot, end='\n')


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n = ii()
l = il()
sm = l[0]
for i in range(1, n):
	sm += (l[i] - 1) * i + l[i]
print(sm)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def outln(var):
	sys.stdout.write(str(var) + '\n')

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = int(data())
arr = l()
for i in range(n - 2, -1, -1):
	arr[i] = arr[i + 1] + arr[i] - 1
print(sum(arr))


n = int(input())
arr = list(map(int, input().split()))
click = 0
for i in range(n):
	if arr[i] == 1:
		click += 1
	else:
		click += (arr[i] - 1) * (i + 1) + 1
print(click)


def q103a():
	num_questions = int(input())
	question_arr = [int(num) for num in input().split()]
	count = len(question_arr)
	for i in range(len(question_arr)):
		count += (i + 1) * (question_arr[i] - 1)
	print(count)
q103a()


def solve(n, arr):
	i = 0
	c = 0
	while i < n:
		c += (arr[i] - 1) * (i + 1) + 1
		i += 1
	return c
n = int(input())
arr = list(map(int, input().split()))
print(solve(n, arr))


import sys
import math
n = int(sys.stdin.readline())
an = [int(x) for x in sys.stdin.readline().split()]
res = an[0]
for i in range(1, n):
	res += (an[i] - 1) * (i + 1)
	res += 1
print(res)


n = int(input())
a = [int(i) for i in input().split()]
t = 0
for i in range(n):
	t += (a[i] - 1) * (i + 1)
print(t + n)


n = eval(input())
temp = input()
temp = temp.split()
temp.reverse()
total = 0
subtotal = 0
for i in range(n):
	temp[i] = int(temp[i])
	subtotal += temp[i]
	total += subtotal - i
print(total)


input()
a = list(map(int, input().split()))
total = 0
total = a[0]
for i in range(1, len(a)):
	total += 1 + (a[i] - 1) * (i + 1)
print(total)


input()
print(sum((i * a - i + 1 for (i, a) in enumerate(map(int, input().split()), 1))))


n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
	if l[i] == 1:
		ans += 1
	elif i == 0 and l[0] != 1:
		ans += l[i]
	else:
		ans += (l[i] - 1) * i + l[i]
print(ans)


a = int(input())
arr = list(map(int, input().split()))
ans = 0
for i in range(1, a + 1):
	ans += (arr[i - 1] - 1) * i + 1
print(ans)


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
n = iinput()
A = rlinput()
ans = 0
for i in range(n):
	ans += A[i] + i * (A[i] - 1)
print(ans)


n = int(input())
arr = list(map(int, input().split()))
cnt = []
s = 0
for i in range(n):
	s += 1 + (i + 1) * (arr[i] - 1)
print(s)


n = int(input())
p = input().split()
l = []
i = 0
while i < n:
	l.append(int(p[i]))
	i = i + 1
s = l[0]
for i in range(1, n):
	s = s + l[i] + i * (l[i] - 1)
print(s)


input()
print(sum((i * x - i + x for (i, x) in enumerate(map(int, input().split())))))


n = int(input())
A = list(map(int, input().split()))
result = 0
for i in range(n):
	result += (A[i] - 1) * (i + 1) + 1
print(result)


n = int(input())
list1 = list(map(int, input().split()))
s = list1[0]
x = 1
for i in range(1, n):
	s += 1
	s += (list1[i] - 1) * (x + 1)
	x += 1
print(s)


n = int(input())
a = list(map(int, input().rstrip().split()))
ans = [0] * (n + 1)
ans = a[0]
for i in range(1, n):
	ans += a[i] + (a[i] - 1) * i
print(ans)


n = int(input())
lst = list(map(int, input().split()))
res = lst[0]
for i in range(1, n):
	res += (lst[i] - 1) * (i + 1) + 1
print(res)


n = int(input())
a = [int(x) for x in input().split()]
ans = a[0]
for i in range(1, n):
	ans += 1 + (a[i] - 1) * (i + 1)
print(ans)


input()
r = 0
for (i, j) in enumerate(map(int, input().split())):
	r += j + (j - 1) * i
print(r)


def shtany(lst):
	count = 0
	for i in range(len(lst)):
		count += (lst[i] - 1) * (i + 1) + 1
	return count
n = int(input())
a = [int(j) for j in input().split()]
print(shtany(a))


from sys import stdin
n = int(stdin.readline().rstrip())
l = list(map(int, stdin.readline().split()))
k = 0
w = 0
for i in range(n):
	w += l[i]
	if l[i] >= 1:
		w += (l[i] - 1) * k
		k += 1
print(w)


n = int(input())
l = list(map(int, input().split()))
if len(set(l)) == 1 and l[0] == 1 or n == 1:
	print(sum(l))
else:
	cnt = l[0]
	for i in range(1, n):
		cnt += l[i] + (l[i] - 1) * i
	print(cnt)


def arr_inp():
	return [int(x) for x in stdin.readline().split()]
from sys import *
(n, a) = (int(input()), arr_inp())
print(sum([a[i] + (a[i] - 1) * i for i in range(n)]))


from math import *
import sys
input = sys.stdin.readline
global flag

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = 1
while t:
	t -= 1
	n = inp()
	a = lis()
	r = 0
	for i in range(n):
		te = (i + 1) * (a[i] - 1) + 1
		r += te
	print(r)


n = int(input())
t = list(map(int, input().split()))
p = t[0]
if n > 1:
	for j in range(1, n):
		p += (t[j] - 1) * (j + 1) + 1
print(p)


n = int(input())
lst = list(map(int, input().strip().split(' ')))
s = 0
for i in range(n):
	s += (lst[i] - 1) * (i + 1) + 1
print(s)


n = int(input())
arr = list(map(int, input().split()))
summ = 0
for (idx, v) in enumerate(arr):
	summ += v + (v - 1) * idx
print(summ)


n = int(input())
a = list(map(int, input().split()))
ans = sum(a)
for i in range(n):
	ans += (a[i] - 1) * i
print(ans)


n = int(input())
a = [int(each) for each in input().split()]
res = 0
for i in range(n):
	if a[i] == 1:
		res += 1
	else:
		res += (i + 1) * (a[i] - 1) + 1
print(res)


c = 0
n = int(input())
clicks = [int(i) for i in input().split()]
for i in range(len(clicks)):
	c += (i + 1) * (clicks[i] - 1)
print(c + n)


n = int(input())
variants = list(map(int, input().split()))
res = 0
for i in range(n):
	v = variants[i]
	currRes = (v - 1) * (i + 1)
	res += currRes + 1
print(res)


n = int(input())
questions = [int(c) for c in input().split()]
ans = sum(((q - 1) * i + 1 for (i, q) in enumerate(questions, 1)))
print(ans)


x = input()
y = input().split()
count = 0
for i in range(0, int(x)):
	if int(y[i]) == 1:
		count += 1
	else:
		count += int(y[i]) + i * (int(y[i]) - 1)
print(count)


n = int(input())
ans = list(map(int, input().split()))
for i in range(len(ans) - 2, -1, -1):
	ans[i] += ans[i + 1] - 1
print(sum(ans))


n = int(input().strip())
answers = [int(ele) for ele in input().strip().split()]
total_clicks = 0
for i in range(n):
	num_wrongs = answers[i] - 1
	total_clicks += num_wrongs * (i + 1) + 1
print(total_clicks)


from itertools import accumulate
n = int(input())
a = list(map(int, input().split()))

def s(v):
	return sum([i + 1 for i in range(v)])
s = a[0]
for i in range(1, n):
	s += a[i] + i * (a[i] - 1)
print(s)


def main():
	(n, aa) = (int(input()), list(map(int, input().split())))
	for (i, a) in enumerate(aa, 1):
		n += i * (a - 1)
	print(n)
main()


try:
	t = int(input())
	a = [int(i) for i in input().split()]
	c = 0
	j = []
	for i in range(t):
		c = (a[i] - 1) * (i + 1) + 1
		j.append(c)
	print(sum(j))
except:
	pass


n = int(input())
a = [int(x) for x in input().split()]
x = sum(a)
for i in range(1, n):
	x += (a[i] - 1) * i
print(x)


import sys
import math
import bisect

def solve(A):
	n = len(A)
	B = [0] * n
	for i in range(n):
		if i == 0:
			B[i] = A[i]
		elif A[i] == 1:
			B[i] = B[i - 1] + 1
		else:
			B[i] = B[i - 1] + 1 + (i + 1) * (A[i] - 1)
	return B[-1]

def main():
	n = int(input())
	A = list(map(int, input().split()))
	ans = solve(A)
	print(ans)
main()


n = int(input())
l = [int(i) for i in input().split()]
if n == 1:
	print(l[0])
	exit()
ans = n
for i in range(n):
	ans += (l[i] - 1) * (i + 1)
print(ans)


n = int(input())
arr = [int(x) for x in input().split()]
ans = 0

def func(i):
	return (i + 1) * (arr[i] - 1) + 1
for i in range(n):
	ans += func(i)
print(ans)


class CodeforcesTask104BSolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.questions = []

	def read_input(self):
		self.n = int(input())
		self.questions = [int(x) for x in input().split(' ')]

	def process_task(self):
		wrong_click_cost = [x for x in range(self.n)]
		cost = 0
		for x in range(self.n):
			cost += 1 + (self.questions[x] - 1) * (1 + wrong_click_cost[x])
		self.result = str(cost)

	def get_result(self):
		return self.result
Solution = CodeforcesTask104BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


x = int(input())
s = [int(n) for n in input().split()]
l = 0
for n in range(x):
	l += (s[n] - 1) * (n + 1) + 1
print(l)


n = int(input())
l = list(map(int, input().split()))
s = sum([l[i] * (i + 1) - i for i in range(n)])
print(s)


n = int(input())
sum1 = 0
cnt = 1
s = input()
l = [int(i) for i in s.split()]
if n > 1:
	for i in range(1, n):
		cnt += 1
		sum1 += 1 + cnt * (l[i] - 1)
	sum1 += l[0]
	print(sum1)
else:
	print(l[0])