Scanf.scanf "%d %d %d %d %d %d %d" (fun ai ao at aj al as_ az ->
    let k = ao               in let ao = ao - ao in
    let k = k + (ai / 2) * 2 in let ai = ai - (ai / 2) * 2 in
    let k = k + (aj / 2) * 2 in let aj = aj - (aj / 2) * 2 in
    let k = k + (al / 2) * 2 in let al = al - (al / 2) * 2 in
    let k = if ai * aj * al = 1 then k + 3 else k in
    Printf.printf "%d\n" k
)