You are given an array a_1,a_2,…,a_n of n integers. Consider S as a set of segments satisfying the following conditions.
The length of the segment \[x,y] is defined as y−x+1. f(S) is defined as the sum of the lengths of every element in S. In a formal way, f(S)=∑_\[x,y]∈S(y−x+1). Note that if S is empty, f(S) is 0.
What is the maximum f(S) among all possible S?
The first line contains one integer n (1≤n≤2⋅105).
The next line is followed by n integers a_1,a_2,…,a_n (−109≤a_i≤109).
Print a single integer, the maximum f(S) among every possible S.