#1行目
hoge = gets.chomp.to_i - 1

#2行目読み込み
b = gets.chomp.split(" ").map!{|i| i.to_i}

a = []
b[hoge] = 1000000000
b[hoge+1] = 1000000000

a[0] = b[0]

for i in 1..hoge do
  if b[i-1] < b[i]
  a[i] = b[i-1]
else
  a[i] = b[i]
end
end

p a.inject(:+)