import java.io.InputStream import java.io.PrintStream fun main() { val reader = FastReader() val writer = FastWriter() val (N, M) = reader.readInts() var count = 0 repeat(N) { val s = reader.read() val r = reader.readInt() if (r >= 1200) { if (s.take(4).any { it == 'x' }) { count++ } } } writer.append(count).println() } class FastReader(private val stream: InputStream = System.`in`) { private val buffer = ByteArray(1024 * 16) private var size = 0 private var pos = 0 private var isEnded = false private fun checkAndReplenishment() { if (isEnded || size > pos) return size = stream.read(buffer, 0, buffer.size) pos = 0 if (size < 0) isEnded = true } fun readByte(): Byte { checkAndReplenishment() return buffer[pos++] } fun read(): String { val bytes = mutableListOf() while (true) { val byte = readByte() if (byte == SPACE || byte == LINE_FEED) break bytes.add(byte) } return bytes.toByteArray().toString(Charsets.UTF_8) } fun readLine(): String { val bytes = mutableListOf() while (true) { val byte = readByte() if (byte == LINE_FEED) break bytes.add(byte) } return bytes.toByteArray().toString(Charsets.UTF_8) } fun skip(i: Int = 1): FastReader { repeat(i) { while (readByte() != LINE_FEED) {} } return this } fun readChar(): Char = read()[0] fun readInt(): Int = read().toInt() fun readLong(): Long = read().toLong() fun readFloat(): Float = read().toFloat() fun readDouble(): Double = read().toDouble() fun readBoolean(): Boolean = read().toBoolean() fun readList(): List = readLine().split(" ") fun readChars(): List = readLine().split(" ").map { it[0] } fun readInts(): List = readLine().split(" ").map { it.toInt() } fun readInts(adjust: Int): List = readLine().split(" ").map { it.toInt() + adjust } fun readLongs(): List = readLine().split(" ").map { it.toLong() } fun readLongs(adjust: Long): List = readLine().split(" ").map { it.toLong() + adjust } fun readFloats(): List = readLine().split(" ").map { it.toFloat() } fun readDoubles(): List = readLine().split(" ").map { it.toDouble() } fun readBooleans(): List = readLine().split(" ").map { it.toBoolean() } companion object { private const val SPACE = ' '.code.toByte() private const val LINE_FEED = '\n'.code.toByte() } } class FastWriter(private val stream: PrintStream = System.out, private val capacity: Int = 1024 * 1024 * 8) { private val writeText = StringBuilder() fun append(any: Any? = ""): FastWriter { writeText.append(any) checkCapacity() return this } fun appendLine(any: Any? = ""): FastWriter { writeText.appendLine(any) checkCapacity() return this } fun print() { stream.print(writeText) writeText.clear() } fun println() { stream.println(writeText) writeText.clear() } private fun checkCapacity() { if (writeText.length > capacity) print() } }