N = int(input()) L = [N] t = N-2 while L[-1]+t>0: L.append(L[-1]+t) t-=2 A = list(map(int,input().split())) ans = 0 for i in range(N): ans+=A[i]*L[i] print(ans)