#include<bits/stdc++.h>
using namespace std;
static const int64_t INF=100000000000;
int64_t N,T;
int64_t dp[200005][31];
int main(){
cin>>N>>T;
  vector<int64_t>A(N);
  vector<int64_t>B(N);
  for(int i=0;i<N;i++){
  int64_t a;cin>>a;A.at(i)=a+1;
    cin>>B.at(i);
  }vector<pair<double,int64_t>>C;vector<int64_t>D;
  for(int64_t i=0;i<N;i++){
  if(A[i]==1)D.push_back(B[i]+1);
    else{
    double a=A[i];double b=B[i];
      pair<double,int64_t>p(-(a+b)/(b+1),i);
      C.push_back(p);
    }
   }sort(C.begin(),C.end());sort(D.begin(),D.end());
  int M=C.size();
  vector<pair<int64_t,int64_t>>P(M);
  for(int i=0;i<M;i++){
int64_t I=C[i].second;
    pair<int64_t,int64_t>p(A[I],B[I]);
    P[i]=p;
  }for(int i=0;i<=M;i++)
    for(int j=1;j<=30;j++)
      dp[i][j]=INF;
  for(int i=1;i<=M;i++)
    for(int j=1;j<=30;j++){
    dp[i][j]=min(dp[i-1][j],P[i-1].first*(dp[i-1][j-1]+1)+P[i-1].second);
    }vector<int64_t>d(N-M+1);
  d[0]=0;
  for(int i=1;i<=N-M;i++)
    d[i]=d[i-1]+D[i-1];
  int64_t ans=0;
  for(int i=0;i<=30;i++){
  if(dp[M][i]<=T){
  auto itr=upper_bound(d.begin(),d.end(),T-dp[M][i]);
    int k=distance(d.begin(),itr);
    if(ans<k+i-1)ans=k+i-1;
   }
  }cout<<ans<<endl;
   return 0;
}