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