function main(input) {
  var N = input[0]-0;
  var b = input[1].split(" ").map(v=>v-0);
  var ans = 0;
  for(var i=0;i<N;i++){
    var a = Number.MAX_VALUE;
    if(i>0){
      a = Math.min(b[i-1], a);
    }
    if(i<N-1){
      a = Math.min(b[i], a);
    }
    if(i<N-2){
      a = Math.min(b[i+1], a);
    }
    ans += a;
  }
  console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
