#include using namespace std; using ll = long long; int N, M; int main() { cin>>N>>M; int ans=0; while(N--) { string S; int r; cin>>S>>r; if(r < 1200) continue; bool ok=true; for(int i=0; i<4; i++)if(S[i]=='x')ok=false; if(!ok) ans++; } cout<