Scanf.scanf "%d %d %d" (fun n m c ->
    let b = Array.init m (fun _ -> Scanf.scanf " %d" (fun b -> b)) in

    let rec loop i acc =
        if i = n then acc else
            let a = Array.init m (fun _ -> Scanf.scanf " %d" (fun a -> a)) in
            let rec loop2 j acc4 =
                if j = m then acc4 else loop2 (j + 1) (acc4 + b.(j) * a.(j))
            in
            loop (i + 1) (if loop2 0 c > 0 then acc + 1 else acc)
    in
    loop 0 0 |> Printf.printf "%d\n"
)