#include<bits/stdc++.h>
using namespace std;
int main() {
int a[1000][7]={0},i,j,n,m,k,h=0,x=0;
cin>>n>>m>>k;
for(i=0;i<n;i++){
for(j=0;j<m;j++){
cin>>a[i][j];
}
}
for(i=0;i<n;i++){
x=0;
for(j=0;j<m;j++){
x=x+a[i][j];
if(x>=k) h++;
}
}
cout<<h;
}
/**************************************************************
Problem: 2026
User: linzihang
Language: C++
Result: Accepted
Time:10 ms
Memory:2072 kb
****************************************************************/