let () =
  Scanf.scanf "%d %d %d" @@ fun n m c ->
  let b = Array.init m (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let a = Array.init n (fun _ ->
    Array.init m (fun _ -> Scanf.scanf " %d" ((+) 0))) in
  Array.init n (fun i -> 
    let s = 
      Array.init m (fun j -> a.(i).(j) * b.(j))
      |> Array.fold_left (+) 0
    in
    if s + c > 0 then 1 else 0)
  |> Array.fold_left (+) 0
  |> Printf.printf "%d\n"
