#include<bits/stdc++.h>
using namespace std;
#define ll long long
struct node
{
	ll f,s;
}a[222222];
ll c[222222],dp[36];
bool mycmp(node xx,node yy)
{
	return xx.f*(yy.s+1)>yy.f*(xx.s+1); 
}
int main()
{
	ll n,t,cnt1=0,cnt2=0,x,y,pp,ans=0;
	cin>>n>>t;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld%lld",&x,&y);
		if(x==0) cnt1++,c[cnt1]=y+1;
		else cnt2++,a[cnt2]={x,y};
	}
	sort(c+1,c+cnt1+1);
	sort(a+1,a+cnt2+1,mycmp);
	for(int i=1;i<=35;i++)
	dp[i]=t+1;
	dp[0]=0;
	for(int i=1;i<=cnt2;i++)
	{
		for(int j=35;j>0;j--)
		{
			dp[j]=min(dp[j],(dp[j-1]+1)*(a[i].f+1)+a[i].s);
		}
	}
	for(int i=1;i<=cnt1;i++) c[i]+=c[i-1];
	for(int i=0;i<=35;i++)
	{
		if(dp[i]>t) continue;
		pp=0;
		if(cnt1)
		{
			pp=upper_bound(c+1,c+cnt1+1,t-dp[i])-c-1;
		}
		ans=max(ans,pp+i);
	}
	cout<<ans;
	return 0;
}