lines = readlines.map{|line| line.split(' ').map(&:to_i)}
a=[]
a.push(lines[1][0])
for i in 0..lines[0][0]-2
  if lines[1][i+1]==nil then
    a.push(lines[1][i])
  else
    a.push([lines[1][i],lines[1][i+1]].min)
  end
end
puts a.inject(:+)