N = int(input()) A = list(map(int,input().split())) ans = 0 k = d = N for a in A: ans += k*a d -= 2 k += d print(ans)