let () =
  Scanf.scanf "%d\n" @@ fun n ->
  let blst = Array.to_list
      (Array.init (n-1) @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d) in
  let (_,ans) = List.fold_left
      (fun (bfr,ans) x -> (x,ans + (min bfr x)))
      (List.hd blst, 0) blst in
  Printf.printf "%d\n" (ans + (List.hd (List.rev blst)))