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