let () = Scanf.scanf "%d %d %d %d %d %d %d" @@ fun ai ao at aj al as_ az ->
  Printf.printf "%d\n" @@ ao + max
    ((ai land (-2)) + (aj land (-2)) + (al land (-2)))
    ( if ai <= 0 || aj <= 0 || al <= 0
      then min_int
      else ((ai - 1) land (-2)) + ((aj - 1) land (-2)) + ((al - 1) land (-2)) + 3 )
