def main():

    import itertools

    import sys

    buf = sys.stdin.buffer





    n, t = list(map(int, buf.readline().split()))

    m = list(map(int, buf.read().split()))

    shops = []

    shopsA0 = [0]



    for a, b in zip(m, m):

        if a == 0:

            shopsA0.append(b + 1)

        else:

            shops.append([a / (b + 1), a, b])



    shopsA0.sort()

    shops.sort(reverse=True)





    DP = [t+10] * 30

    DP[0] = 0



    for _, a, b in shops:

        for num in range(28, -1, -1):

            candidate = (DP[num]+1) * (a+1) + b

            if candidate < DP[num+1]:

                DP[num+1] = candidate



    cumA0 = list(itertools.accumulate(shopsA0))



    ans = [0]

    count_A0 = len(cumA0) - 1

    for count, spend_time in enumerate(DP):

        residue = t - spend_time

        if residue < 0:

            break

        while count_A0 > 0 and cumA0[count_A0] > residue:

            count_A0 -= 1

        ans.append(count_A0 + count)

    print((max(ans)))





if __name__ == '__main__':

    main()
def main():

    import itertools

    import sys

    buf = sys.stdin.buffer





    n, t = list(map(int, buf.readline().split()))

    m = list(map(int, buf.read().split()))

    shops = []

    shopsA0 = [0]



    for a, b in zip(m, m):

        if a == 0:

            shopsA0.append(b + 1)

        else:

            shops.append([a, b])



    shopsA0.sort()

    shops.sort(reverse=True, key=lambda x: x[0]/(x[1]+1))





    DP = [t+10] * 30

    DP[0] = 0



    for a, b in shops:

        for num in range(28, -1, -1):

            candidate = (DP[num]+1) * (a+1) + b

            if candidate < DP[num+1]:

                DP[num+1] = candidate



    cumA0 = list(itertools.accumulate(shopsA0))



    ans = [0]

    count_A0 = len(cumA0) - 1

    for count, spend_time in enumerate(DP):

        residue = t - spend_time

        if residue < 0:

            break

        while count_A0 > 0 and cumA0[count_A0] > residue:

            count_A0 -= 1

        ans.append(count_A0 + count)

    print((max(ans)))





if __name__ == '__main__':

    main()
def main():
    import itertools
    import sys

    buf = sys.stdin.buffer
    n, t = list(map(int, buf.readline().split()))
    m = list(map(int, buf.read().split()))
    shops = []
    shopsA0 = [0]
    for a, b in zip(m, m):
        if a == 0:
            shopsA0.append(b + 1)
        else:
            shops.append([a / (b + 1), a, b])
    shopsA0.sort()
    shops.sort(reverse=True)
    DP = [t + 10] * 30
    DP[0] = 0
    for _, a, b in shops:
        for num in range(28, -1, -1):
            candidate = (DP[num] + 1) * (a + 1) + b
            if candidate < DP[num + 1]:
                DP[num + 1] = candidate
    cumA0 = list(itertools.accumulate(shopsA0))
    ans = [0]
    count_A0 = len(cumA0) - 1
    for count, spend_time in enumerate(DP):
        residue = t - spend_time
        if residue < 0:
            break
        while count_A0 > 0 and cumA0[count_A0] > residue:
            count_A0 -= 1
        ans.append(count_A0 + count)
    print((max(ans)))


if __name__ == "__main__":
    main()

def main():
    import itertools
    import sys

    buf = sys.stdin.buffer
    n, t = list(map(int, buf.readline().split()))
    m = list(map(int, buf.read().split()))
    shops = []
    shopsA0 = [0]
    for a, b in zip(m, m):
        if a == 0:
            shopsA0.append(b + 1)
        else:
            shops.append([a, b])
    shopsA0.sort()
    shops.sort(reverse=True, key=lambda x: x[0] / (x[1] + 1))
    DP = [t + 10] * 30
    DP[0] = 0
    for a, b in shops:
        for num in range(28, -1, -1):
            candidate = (DP[num] + 1) * (a + 1) + b
            if candidate < DP[num + 1]:
                DP[num + 1] = candidate
    cumA0 = list(itertools.accumulate(shopsA0))
    ans = [0]
    count_A0 = len(cumA0) - 1
    for count, spend_time in enumerate(DP):
        residue = t - spend_time
        if residue < 0:
            break
        while count_A0 > 0 and cumA0[count_A0] > residue:
            count_A0 -= 1
        ans.append(count_A0 + count)
    print((max(ans)))


if __name__ == "__main__":
    main()

-            shops.append([a / (b + 1), a, b]) +            shops.append([a, b]) -    shops.sort(reverse=True) +    shops.sort(reverse=True, key=lambda x: x[0] / (x[1] + 1)) -    for _, a, b in shops: +    for a, b in shops: