[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main argv =
    let [n;_;c] = reads int
    let bs = reads int
    let ass = List.map (fun _ -> reads int) [1..n]
    seq {
        for xs in ass do
            let ab = List.map2 (*) bs xs |> List.sum
            if ab + c > 0 then yield ()
    }
    |> Seq.length
    |> printfn "%i"
    0