import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) A=[int(i) for i in input().split()] ans=0 for i in range(n): ans+=A[i]*(i+1)*(n-i) print(ans)