let () = Printf.printf "%d\n" @@ 
  let array = Array.make 5 0 in
  for i=0 to 4 do
    if i < 4 then Scanf.scanf " %d" @@ fun x -> array.(i) <- x
    else Scanf.scanf " %d\n" @@ fun x -> array.(i) <- x
  done;
  List.find (fun i -> array.(i-1) = 0) @@
  List.init 5 (fun i -> i+1)