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