let () = Scanf.scanf "%d\n" @@ fun n ->
  let bs = Array.init (n - 1) @@ fun _ -> Scanf.scanf "%d " @@ fun b -> b in
  Printf.printf "%d\n" @@
  Array.fold_left ( + ) (bs.(0) + bs.(n - 2)) @@
  Array.init (n - 2) @@ fun i -> min bs.(i) bs.(i + 1)

