#include <iostream>

using namespace std;
int n,m,b[30],a[30][30],c;
int main(){
	int i,j,ans = 0;
	cin >> n >> m >> c;
	for(i=0;i<m;i++){
		cin >> b[i];
	}
	for(i=0;i<n;i++){
		int k = c;
		for(j=0;j<m;j++){
			cin >> a[i][j];
			k += a[i][j]*b[j];
		}
		if(k>0) ans++;
	}
	cout << ans << endl;
}
	