let input_array n = Array.init n (fun _ -> Scanf.scanf " %d" (fun e -> e));;

let correct a b c = let ab = Array.mapi (fun i ai -> ai * b.(i)) a in Array.fold_right (+) ab c > 0;;

let () = Scanf.scanf "%d %d %d" (fun n m c -> (
  let b = input_array m in
  let cnt = ref 0 in (
    for i = 1 to n do
      let a = input_array m in
      if correct a b c then cnt := !cnt + 1
    done;
    Printf.printf "%d\n" !cnt
  )
))