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