N = gets.to_i A = gets.split(" ").map{|s| s.to_i} sum = 0 A.each_with_index {|a, i| sum += (N-i) * (i+1) * A[i] } puts sum