import Foundation

extension String {
    func split(separator: String) -> [Int] {
        return self.componentsSeparatedByString(separator).map { Int($0)! }
    }
}

let input = readLine()!.split(" ")
let N = input[0]
let M = input[1]
let C = input[2]
let B = readLine()!.split(" ")

var ans = 0
for _ in 0..<N {
    let A = readLine()!.split(" ")
    var sum = 0
    for i in 0..<M {
        sum += A[i] * B[i]
    }
    if sum + C > 0 {
        ans += 1
    }
}

print(ans)