import Control.Monad
main = do
  [n,_,c] <- map read . words <$> getLine
  b <- map read . words <$> getLine
  as <- replicateM n $ map read . words <$> getLine
  print $ length $ filter ( > 0) (map (f c b) as)
f x y z = sum (zipWith (*) y z) + x
