import java.io.PrintWriter
import java.util.*


@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = Array(n) { read() }
fun readLines(n: Int) = Array(n) { readLn() }
fun readInts(n: Int) = Array(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = Array(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = Array(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)
inline fun output(block: PrintWriter.() -> Unit) { _writer.apply(block).flush() }

class Store(val a: Int, val b: Int) : Comparable<Store> {
    override fun compareTo(o: Store): Int {
        if (a == 0 && o.a == 0)
            return b.compareTo(o.b)
        return ((a.toLong() * (o.b + 1)).compareTo(o.a.toLong() * (b + 1)))
    }
}

val mem = Array(30) { Array(200010) { -1 } }
fun dp(j: Int, id: Int, stores: Array<Store>): Int {
    if (stores.size == id) {
        return (if (j == 0) 0 else 1.shl(30))
    }
    if (mem[j][id] != -1) return mem[j][id]
    var w = 1.shl(30)
    if (j > 0) {
        val t = dp(j - 1, id + 1, stores) + 1
        w = Math.min(w.toLong(), t + t.toLong() * stores[id].a + stores[id].b).toInt()
    }
    w = Math.min(w, dp(j, id + 1, stores))
    mem[j][id] = w
    return w
}

fun main(args: Array<String>) {
    val (N, T) = readInts(2)
    val stores = (0 until N).map {
        val (a, b) = readInts(2)
        Store(a, b)
    }.sorted().toTypedArray()

    val (firstNonZero) = listOf(stores.indexOfFirst { it.a != 0 }).map { if (it == -1) N else it }

    var mx = 0
    for (i in 0..N) {

        for (id in (firstNonZero..N).reversed()) {
            if (stores.size == id) {
                mem[i][id] = (if (i == 0) 0 else 1.shl(30))
            } else {
                var w = 1.shl(30)
                if (i > 0) {
                    val t = mem[i - 1][id + 1] + 1
                    w = Math.min(w.toLong(), t + t.toLong() * stores[id].a + stores[id].b).toInt()
                }
                w = Math.min(w, mem[i][id + 1])
                mem[i][id] = w
            }
        }
        var t = mem[i][firstNonZero]

        if (t > T) break
        var cnt = i
        for (s in 0 until firstNonZero) {
            if (t + stores[s].b + 1 <= T) {
                t += stores[s].b + 1
                cnt += 1
            }
        }
        mx = Math.max(mx, cnt)
    }
    println(mx)
}

/*
1 1 5 -> 3
1 5 1 -> 2
5 1 1 -> 1
 */
