import std.stdio, std.string, std.conv, std.algorithm;

void main() {
    int n = readln.chomp.to!int;
    int[] a = new int[n];
    int[] b = readln.chomp.split.to!(int[]);
    a[0] = b[0], a[1] = b[0];
    foreach (i; 1 .. n-1) {
        a[i] = min(a[i], b[i]);
        a[i+1] = b[i];
    }
    a.sum.writeln;
}