#abc140c. [abc140_c]Maximal Value

[abc140_c]Maximal Value

Problem Statement

There is an integer sequence AA of length NN whose values are unknown.

Given is an integer sequence BB of length N1N-1 which is known to satisfy the following:

Bigeqmax(Ai,Ai+1)B_i \\geq \\max(A_i, A_{i+1})

Find the maximum possible sum of the elements of AA.

Constraints

  • All values in input are integers.
  • 2leqNleq1002 \\leq N \\leq 100
  • 0leqBileq1050 \\leq B_i \\leq 10^5

Input

Input is given from Standard Input in the following format:

NN B1B_1 B2B_2 ...... BN1B_{N-1}

Output

Print the maximum possible sum of the elements of AA.


Sample Input 1

3
2 5

Sample Output 1

9

AA can be, for example, ( 22 , 11 , 55 ), ( \-1\-1 , \-2\-2 , \-3\-3 ), or ( 22 , 22 , 55 ). Among those candidates, AA = ( 22 , 22 , 55 ) has the maximum possible sum.


Sample Input 2

2
3

Sample Output 2

6

Sample Input 3

6
0 153 10 10 23

Sample Output 3

53