open Printf open Scanf
open Array

let gi _ = scanf " %d" @@ fun v -> v

let () = scanf " %d %d %d" @@ fun n m c ->
  let b = init m (fun _ -> gi ()) in
  init n (fun _ ->
    let a = init m (fun _ -> gi ()) in
    let w = init m (fun i -> a.(i)*b.(i))
    |> fold_left (+) 0 in
    if w+c > 0 then 1 else 0
  )
  |> fold_left (+) 0
  |> print_int