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