main :: IO ()
main = do
  [n, m, c] <- map read . words <$> getLine
  bs <- map read . words <$> getLine
  ass <- sequence . replicate n $ map read . words <$> getLine
  print . length . filter (> 0) . map ((+ c) . sum . zipWith (*) bs) $ ass
