main = do
  [n,m,c] <- map read . words <$> getLine :: IO [Int]
  bs <- map read . words <$> getLine :: IO [Int]
  as <- map (map read . words) . lines <$> getContents :: IO [[Int]]
  print $ length $ filter (\a -> c + (sum $ zipWith (*) bs a) > 0) as