#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	int n,m,c;
	cin >> n >> m >> c;
	int a[n][m],b[m],count=0;
	rep(i,m)cin>>b[i];
	rep(i,n){
		int sum=c;
		rep(j,m){
			cin>>a[i][j];
			sum+=a[i][j]*b[j];
		}
		count+=sum>0?1:0;
	}
	cout << count << endl;
}