N, M, C = gets.split.map(&:to_i)
B_array = gets.split.map(&:to_i)
A_matrix = []

N.times{|i|
  A_matrix << gets.split.map(&:to_i)
}

result_num = 0
A_matrix.each{|row|
  answer = 0
  row.each_with_index{|item,idx|
    answer += item*B_array[idx]
  }

  if ((answer + C) > 0)
    result_num += 1 
  end
}

puts result_num
