let () = Scanf.scanf "%d %d %d %d %d %d %d" @@ fun ai ao at aj al as_ az ->
  Printf.printf "%d\n" @@ (ai - ai mod 2) + ao + (aj - aj mod 2) + (al - al mod 2) + 3 * (ai mod 2) * (aj mod 2) * (al mod 2)
