#include<bits/stdc++.h>
using namespace std;
const int M=1000000007;
const int N=200005;
int i,n,dp[200005][55],p[N],k,T,ans,j;
struct str{
	int a,b;
}a[N];
bool cmp(str a,str b)
{
	return 1ll*(a.b+1)*b.a<1ll*(b.b+1)*a.a;
}
int main()
{
	scanf("%d %d",&n,&T);
	for(i=1;i<=n;++i)
	{
		scanf("%d %d",&a[i].a,&a[i].b);
		if(a[i].a==0)
		{
			p[++k]=a[i].b;
			--i,--n;
		}
	}
	sort(a+1,a+1+n,cmp);
	for(j=1;j<=50;++j)
		dp[0][j]=T+1;
	for(i=1;i<=n;++i)
	{
		for(j=1;j<40;++j)
			dp[i][j]=min(1ll*dp[i-1][j],dp[i-1][j-1]+1+1ll*(dp[i-1][j-1]+1)*a[i].a+a[i].b);//printf("%lld ",dp[i][j]);
//		printf("\n");
	}
	sort(p+1,p+1+k);
	for(i=0;i<=30;++i)
	{
//		printf("%lld ",dp[n][i]);
		if(dp[n][i]<=T)
		{
			long long s=0;
			for(j=1;j<=k;++j)
			{
				s+=p[j]+1;
				if(dp[n][i]+s>T)
					break;
			}
			ans=max(ans,j-1+i);
		}
	}
	cout<<ans;
}