
import qualified Data.Vector                   as V
import           Control.Applicative
import           Control.Monad


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

  print $ length $ filter (> 0) $ map (+ c) $ f as bs [0 .. m - 1]

f []       bs is = []
f (a : as) bs is = f as bs is ++ [g a bs is 0]

g as bs []       ans = ans
g as bs (i : is) ans = g as bs is $ ans + (as !! i) * (bs !! i)
