The first line contains one integer $n$ ($1 \le n \le 10^6$) — the length of the sequence.
The second line contains n integers $a_i$ ($1 \le i \le n, 1 \le a_i \le 10^6$) — the sequence.
输出格式
Print the answer to the equation.
样例输入 #1
10
99 62 10 47 53 9 83 33 15 24
样例输出 #1
248
样例输入 #2
10
6 7 5 5 4 9 9 1 8 12
样例输出 #2
134
来源
2018-2019 ACM-ICPC Asia Nanjing Regional Contest Problem J