#ABC121B. [ABC121B] Can you solve this?

[ABC121B] Can you solve this?

Score : 200200 points

Problem Statement

There are NN pieces of source code. The characteristics of the ii-th code is represented by MM integers Ai1,Ai2,...,AiMA_{i1}, A_{i2}, ..., A_{iM}.

Additionally, you are given integers B1,B2,...,BMB_1, B_2, ..., B_M and CC.

The ii-th code correctly solves this problem if and only if Ai1B1+Ai2B2+...+AiMBM+C>0A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0.

Among the NN codes, find the number of codes that correctly solve this problem.

Constraints

  • All values in input are integers.
  • 1N,M201 \leq N, M \leq 20
  • 100Aij100-100 \leq A_{ij} \leq 100
  • 100Bi100-100 \leq B_i \leq 100
  • 100C100-100 \leq C \leq 100

Input

Input is given from Standard Input in the following format:

NN MM CC

B1B_1 B2B_2 ...... BMB_M

A11A_{11} A12A_{12} ...... A1MA_{1M}

A21A_{21} A22A_{22} ...... A2MA_{2M}

\vdots

AN1A_{N1} AN2A_{N2} ...... ANMA_{NM}

Output

Print the number of codes among the given NN codes that correctly solve this problem.

2 3 -10
1 2 3
3 2 1
1 2 2
1

Only the second code correctly solves this problem, as follows:

  • Since $3 \times 1 + 2 \times 2 + 1 \times 3 + (-10) = 0 \leq 0$, the first code does not solve this problem.
  • $1 \times 1 + 2 \times 2 + 2 \times 3 + (-10) = 1 > 0$, the second code solves this problem.
5 2 -4
-2 5
100 41
100 40
-3 0
-6 -2
18 -13
2
3 3 0
100 -100 0
0 100 100
100 100 100
-100 100 100
0

All of them are Wrong Answer. Except yours.