N = int(eval(input()))

B = [int(x) for x in input().split()]

A = [10**5] * N

for i, b in enumerate(B):

    A[i] = min(A[i], b)

    A[i+1] = min(A[i+1], b)

print((sum(A)))

def main() -> None:

    N = int(eval(input()))

    B = [int(x) for x in input().split()]

    ans = B[0] + B[-1]

    for i in range(N - 2):

        ans += min(B[i], B[i+1])

    print(ans)





if __name__ == '__main__':

    main()

N = int(eval(input()))
B = [int(x) for x in input().split()]
A = [10**5] * N
for i, b in enumerate(B):
    A[i] = min(A[i], b)
    A[i + 1] = min(A[i + 1], b)
print((sum(A)))

def main() -> None:
    N = int(eval(input()))
    B = [int(x) for x in input().split()]
    ans = B[0] + B[-1]
    for i in range(N - 2):
        ans += min(B[i], B[i + 1])
    print(ans)


if __name__ == "__main__":
    main()

-N = int(eval(input())) -B = [int(x) for x in input().split()] -A = [10**5] * N -for i, b in enumerate(B): -    A[i] = min(A[i], b) -    A[i + 1] = min(A[i + 1], b) -print((sum(A))) +def main() -> None: +    N = int(eval(input())) +    B = [int(x) for x in input().split()] +    ans = B[0] + B[-1] +    for i in range(N - 2): +        ans += min(B[i], B[i + 1]) +    print(ans) + + +if __name__ == "__main__": +    main()