#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<queue>
#define ll long long
#define maxn 200010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static int buf[20],len; len=0;
	if(x<0)x=-x,putchar('-');
	for(;x;x/=10)buf[len++]=x%10;
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
struct Data{
	int x,y;
	friend bool operator < (Data a,Data b)
	{
		return (ll)a.x*(b.y+1)!=(ll)b.x*(a.y+1)?(ll)a.x*(b.y+1)>(ll)b.x*(a.y+1):a.y<b.y;
	}
}a[maxn];
ll f[maxn][30];
int n,T;
int main()
{
	n=read(); T=read();
	for(int i=1;i<=n;i++)
		a[i].x=read(),a[i].y=read();
	std::sort(a+1,a+n+1);
	int tot=0;
	while(tot<n&&a[tot+1].x)++tot;
	for(int i=1;1<<i<=T;i++)
		f[0][i]=T+1;
	f[0][0]=0;
	for(int i=1;i<=tot;i++){
		f[i][0]=0;
		for(int j=1;1<<j<=T;j++)
			f[i][j]=std::min(f[i-1][j],f[i-1][j-1]+1+(ll)a[i].x*(f[i-1][j-1]+1)+a[i].y);
	}
	int ans=0;
	for(int i=0;1<<i<=T;i++)
		if(f[tot][i]<=T){
			int cur=i,p=tot+1,cost=f[tot][i];
			while(p<=n&&cost+a[p].y+1<=T){
				++cur;
				cost+=a[p++].y+1;
			}
			ans=std::max(ans,cur);
		}
	writeln(ans);
	return 0;
}