#include <bits/stdc++.h>
using namespace std ;
const int N = 2e5 + 10 ;
typedef long long ll ;
pair<ll , ll> a[N] ;
ll c[N] ;
ll dp[32] ;
bool cmp(pair<ll , ll> a , pair<ll , ll> b)
{
  return a.first * (b.second + 1) > b.first * (a.second + 1) ;
}
int main()
{
  ll n , t ;
  scanf("%lld%lld" , &n , &t) ;
  ll cnt1 = 0 , cnt2 = 0 ;
  for(ll i = 1 , x , y ; i <= n ;i ++)
   {
     scanf("%lld%lld" , &x , &y) ;
     if(x == 0) c[++ cnt2] = y + 1;
     else a[++ cnt1] = {x , y} ;
   }
   sort(c + 1 , c + cnt2 + 1) ;
   sort(a + 1 , a + cnt1 + 1 , cmp) ;
   for(int i = 1; i <= 30 ;i ++) dp[i] = t + 1 ;
   dp[0] = 0 ;
   for(int i = 1; i <= cnt1 ;i ++)
   {
     for(int j = 30 ;j >= 1 ;j --)
      dp[j] = min(dp[j] , (dp[j - 1] + 1) * (a[i].first + 1)+ a[i].second) ;
   }
   int cnt = 0 ;
   for(int i = 1; i <= cnt2 ;i ++) c[i] += c[i - 1] ;
   int ans = 0 ;
   for(int i = 0 ;i <= 30 ;i ++)
    {
      if(dp[i] > t) continue ;
      int j = 0 ;
      if(cnt2)
       j = upper_bound(c + 1 , c + cnt2 + 1 , t - dp[i]) - c - 1;
      ans = max(ans , i + j) ;
    }
  cout << ans << endl ;
  return 0 ;
}
