#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>
#include <cassert>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
class Solve {
public:
    void solve() {
        Int N, T;
        cin >> N >> T;
        vector<Int> a(N), b(N);
        for (int i = 0; i < N; ++i) {
            cin >> a[i] >> b[i];
        }

        vector<pair<Int, Int>> ab; // a > 0
        vector<Int> c; // a == 0
        for (int i = 0; i < N; ++i) {
            if (a[i] > 0) ab.emplace_back(a[i], b[i]);
            else c.push_back(b[i] + 1);
        }

        sort(all(ab), [](auto l, auto r) {
            Int ai = l.first;
            Int bi = l.second;
            Int aj = r.first;
            Int bj = r.second;
            return aj * (1 + bi) < ai * (1 + bj);
        });

        Int n = ab.size();
        vector<vector<Int>> dp(n + 1, vector<Int>(31, INFl));
        dp[0][0] = 0;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < dp[i].size(); ++j) {
                if (dp[i][j] != INFl) {
                    Int t = dp[i][j];
//                    for (int k = 0; k < dp[i].size(); ++k) {
//                    }
                    {
                        // use
                        Int nt = t + 1 + ab[i].first * (t + 1) + ab[i].second;
                        if (nt <= T) {
                            chmin(dp[i + 1][j + 1], nt);
                        }
                    }

                    {
                        // not use
                        chmin(dp[i + 1][j], dp[i][j]);
                    }
                }
            }
        }

        sort(all(c));
        vector<Int> sc(c.size());
        if (sc.size())sc[0] = c[0];
        for (int i = 1; i < c.size(); ++i) {
            sc[i] = sc[i - 1] + c[i];
        }

        Int ans = 0;
        for (int i = 0; i < dp[0].size(); ++i) {
            if (dp[n][i] <= T) {
                Int left = i;
                Int right = upper_bound(all(sc), T - dp[n][i]) - sc.begin();
                Int tmp = left + right;
                chmax(ans, tmp);
            }
        }
        cout << ans << endl;
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 61292