#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

typedef pair<double, double> pd;
typedef vector<pd> vpd;


#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> t chmax(t&a,u b){if(a<b)a=b; return a;};
template<class t, class u> t chmin(t&a,u b){if(a>b)a=b; return a;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

ll N, T;
vector<pair<double, pair<ll, ll>>> ABP;
vll TB;

/*
ll search(ll pos, ll t){
  if(pos>=N) return 0;
  if(t>T) return 0;
  ll tmp = search(pos+1, t);
  ll a = ABP[pos].second.first;
  ll b = ABP[pos].second.second;
  ll t_after = a*t+b + t;
  if(t_after<=T){
    return max(tmp, search(pos+1, t_after+1)+1);
  }
  return tmp;
}
*/
constexpr ll K = 30;
void search(ll pos){
  if(pos<N){
    ll a = ABP[pos].second.first;
    ll b = ABP[pos].second.second;
    if(a>0){
      RREP(i,K-2){
        if(TB[i]<=T+10){
          chmin(TB[i+1], TB[i] + a*TB[i]+b + 1);
        }
      }
    }
    search(pos+1);
  }
  return;
}

ll search2(void){
  vll zero_b;
  REP(i,N){
    ll a = ABP[i].second.first;
    ll b = ABP[i].second.second;
    if(a==0) zero_b.pb(b);
  }
  if(zero_b.size()>0){
    sort(ALL(zero_b));
    vll sum_b(zero_b.size(), 0);
    sum_b[0] = zero_b[0]+1;
    FOR(i,1,zero_b.size()){
      sum_b[i] = sum_b[i-1] + zero_b[i]+1;
    }

    ll ans = 0;

    //vec_print(sum_b);

    REP(i,K){
      if(TB[i]>T+1) continue;
      ll tmp = upper_bound(ALL(sum_b), T+1-TB[i]) - sum_b.begin();
      chmax(ans, i+tmp);
      debug_print(i, TB[i], tmp);
    }
    return ans;
  }else{
    vec_print(TB);
    RREP(i,K-1){
      if(TB[i]<=T+1) return i;
    }
    return 0;
  }
}

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  IN(N,T);
  ABP.resize(N);
  TB.resize(K, INFLL);
  TB[0] = 1;
  REP(i,N){
    ll a, b;
    IN(a,b);
    double tmp = a/(1.0+b);
    ABP[i].first = tmp;
    ABP[i].second.first = a;
    ABP[i].second.second = b;
  }

  sort(ALL(ABP));
  reverse(ALL(ABP));

  search(0);
  ll ans = search2();
  OUT(ans);

  return 0;
}

Measured memory_bytes: 8176