let () = Scanf.scanf "%d %d %d\n" @@ fun n m c ->
  let bs = Array.to_list @@ Array.init m @@ fun _ -> Scanf.scanf "%d " @@ fun b -> b in
  let ass = Array.to_list @@ Array.init n @@ fun _ ->
    Array.to_list @@ Array.init m @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  Printf.printf "%d\n" @@
    List.length @@
    List.filter (( < ) 0) @@
    List.map (List.fold_left2 (fun a b c -> a + b * c) c bs) ass
