let min_list list = List.fold_right min list max_int;;

let () = Scanf.scanf "%d\n%d\n%d\n%d\n%d\n%d" (fun n a b c d e -> 
  let min_val = min_list [a; b; c; d; e] in
    (if n mod min_val = 0 then n / min_val + 4
    else n / min_val + 5) |> print_int
);;