#include using namespace std; int main() { int N, M, Ans = 0; cin >> N >> M; for (int i = 0; i < N; i++) { bool wa = false; string S; int R; cin >> S >> R; for (int j = 0; j < M; j++) if (S.at(j) == 'x' && j < 4) wa = true; if (wa && R >= 1200) Ans++; } cout << Ans << endl; }