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