#ifdef sys #define _GLIBCXX_DEBUG #endif #include using namespace std; using ull = unsigned long long; using ll = long long; using ld = long double; using lll = __int128; using llld = _Float128; #define el "\n" #define all(x) x.begin(), x.end() #define initv2(t,a,...) a, vector(__VA_ARGS__) #define initv3(t,a,b,...) a, vector>(b, vector(__VA_ARGS__)) #define pair(a,b) pair #define COUNT(a,b) count_if(a, [&](auto _Cx){return _Cx b;}) #define vec vector #define elif else if namespace Myb{ long long LLINF = 1010101010101010101; int INF = 1010101010; namespace Myb_ios{ template istream& operator>>(istream& ist, pair& p) {cin >> p.first >> p.second; return ist;} template istream& operator>>(istream& ist, vector& v) {for(T& i : v) cin >> i; return ist;} istream& operator>>(istream& ist, _Float128& x) {long double n; cin >> n; x = n; return ist;} void read_d_graph(vector>>& v, int m, int num = -1){ int a, b; long long c; for(int _ = 0; _ < m; _++){ cin >> a >> b >> c; a += num; b += num; v[a].emplace_back(c, b); } return; } void read_d_graph(vector>& v, int m, int num = -1){ int a, b; for(int _ = 0; _ < m; _++){ cin >> a >> b; a += num; b += num; v[a].emplace_back(b); } return; } void read_ud_graph(vector>>& v, int m, int num = -1){ int a, b; long long c; for(int _ = 0; _ < m; _++){ cin >> a >> b >> c; a += num; b += num; v[a].emplace_back(c, b); v[b].emplace_back(c, a); } return; } void read_ud_graph(vector>& v, int m, int num = -1){ int a, b; for(int _ = 0; _ < m; _++){ cin >> a >> b; a += num; b += num; v[a].emplace_back(b); v[b].emplace_back(a); } return; } template void read_multi(T& v, int n) {} template void read_multi(T& v, int n, U&&... args){ if(n >= v.size()) read_multi(args...); else { cin >> v[n]; read_multi(args..., v, n+1); } } string input() {string res; cin >> res; return res;} long long inputl() {long long res; cin >> res; return res;} template ostream& operator<<(ostream& ost, const pair p) {cerr << "{"; ost << p.first << " " << p.second; cerr << "}"; return ost;} template ostream& operator<<(ostream& ost, const vector& v) {for(int i = 0; i < v.size(); i++) {if(i) ost << " "; ost << v[i];} return ost;} template ostream& operator<<(ostream& ost, const vector>& v) {for(int i = 0; i < v.size(); i++) {if(i) ost << "\n"; ost << v[i];} return ost;} } using namespace Myb_ios; long long add_each(long long n) {return n;} template void add_each(long long n, vector& v, U&... args) { for(auto& i : v) i += n; add_each(n, args...); } template bool chmin(T& a, U b) {if(a > b){a = b; return true;} return false;} template bool chmax(T& a, U b) {if(a < b){a = b; return true;} return false;} template T minv(const vector& v) {return *min_element(v.begin(), v.end());} template T maxv(const vector& v) {return *max_element(v.begin(), v.end());} long long power(long long val, long long num, long long mod = LLONG_MAX){ assert(mod > 0); assert(num >= 0); val %= mod; long long res = 1; if(mod < INT_MAX || mod == LLONG_MAX){ while(num){ if(num&1) res = (res*val)%mod; val = (val*val)%mod; num >>= 1; } } else { while(num){ if(num&1) res = (__int128(res)*val)%mod; val = (__int128(val)*val)%mod; num >>= 1; } } return res; } long long comb(long long N, long long K, int mod = 0){ const int COMBSIZ = 200000; assert(mod >= 0); if(N < K || K < 0) return 0; static vector combf(COMBSIZ+9, -1); long long res; if(mod != 0){ assert(N <= COMBSIZ); if(combf[0] == -1){ combf[0] = 1; for(long long i = 1; i <= COMBSIZ; i++) combf[i] = (combf[i-1]*i)%mod; } res = (combf[N]*power((combf[N-K]*combf[K])%mod, mod-2, mod))%mod; return res; } else { long long a=1, b=1; K = min(K, N-K); for(long long i = N; i > N-K; i--) a *= i; for(long long i = 2; i <= K; i++) b *= i; return a/b; } } } using namespace Myb; #if __has_include() #include using namespace atcoder; using mint9 = modint998244353; using mint1 = modint1000000007; ostream& operator<<(ostream& ost, const mint1& x) {ost << x.val(); return ost;} ostream& operator<<(ostream& ost, const mint9& x) {ost << x.val(); return ost;} ostream& operator<<(ostream& ost, const modint& x) {ost << x.val(); return ost;} #endif /*vvv^vvvv^vvvvv^^^^^^^^^vv^^^^^^vvvvv^^^vvvvv^^^^^^^^vvvvvvvvv^^^^^^^vvvvvvvvv^^^vv^^^vvvvvvvv^^^^vvvvvv^^vvvvvv^^^^vvv^^^vvvvvvvv^^^vv^^^^^^^vvvvvvvvv^^^^^_^^vvvvvvvv^^^^^^^^vvvv^vvvvvvvvv^^^^^^^v*/ signed main(){ ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vec S(n); vec R(n); read_multi(S, 0, R, 0); for(int i = 0; i < n; i++) S[i] += "oooo"; int ans = 0; for(int i = 0; i < n; i++){ if(R[i] >= 1200){ bool ng = false; for(int j = 0; j < 4; j++){ if(S[i][j] == 'x') ng = true; } if(ng) ans++; } } cout << ans << el; }