import Control.Monad

main = do
    [n,m,c] <- map read . words <$> getLine :: IO [Int]
    bs <-  map read . words <$> getLine :: IO [Int]
    ass <- replicateM n (map read . words <$> getLine) :: IO [[Int]]
    print . sum $ map (solve c bs) ass

solve :: Int -> [Int] -> [Int] -> Int
solve c bs as = if (sum $ zipWith (*) as bs) + c > 0 then 1 else 0