문제
The United Cows of Farmer John (UCFJ) are sending a delegation to the International bOvine olympIad (IOI).
There are
The delegation will consist of a contiguous interval of at least two cows - that is, cows
Help the UCFJ determine (for tax reasons) the number of ways they might choose a delegation to send to the IOI.
입력
The first line contains
The second line contains
출력
The number of possible delegations, on a single line.
Note that the large size of integers involved in this problem may require the use of 64-bit integer data types (e.g., a "long long" in C/C++).
예제1
7
1 2 3 4 3 2 5
13
Each delegation corresponds to one of the following pairs of leaders: