#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
#define int ll

bool cmp(pair<int, int> x, pair<int, int> y) {
  return y.F * x.S + y.S < x.F * y.S + x.S;
}

const int N = 2e5 + 10;
const int L = 32;
int dp[N][L];

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, t;
  cin >> n >> t;
  vector<pair<int, int>> kek;
  vector<int> lst;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    a++;
    b += a;
    if (a == 1) {
      lst.pb(b);
    }
    else {
      kek.pb({a, b});
    }
  }
  sort(all(lst));
  sort(all(kek), cmp);
  dp[0][0] = 0;
  for (int i = 1; i < L; i++) {
    dp[0][i] = t + 1;
  }
  for (int i = 1; i <= SZ(kek); i++) {
    dp[i][0] = 0;
    for (int j = 1; j < L; j++) {
      dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - 1] * kek[i - 1].F + kek[i - 1].S);
    }
  }
  int ans = 0;
  for (int i = 0; i < L; i++) {
    int sum = dp[SZ(kek)][i], cur = i;
    if (dp[SZ(kek)][i] > t) {
      continue;
    }
    for (int j = 0; j < SZ(lst); j++) {
      if (sum + lst[j] <= t) {
        sum += lst[j];
        cur++;
      }
    }
    ans = max(ans, cur);
  }
  cout << ans << '\n';
} 