#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
#include <vector>
using namespace std;
typedef long long LL;

struct node{
	LL a,b;
}s[200005];
bool cmp(node x,node y){
	if(x.a == 0 && y.a == 0) return x.b < y.b;
	return y.a * (x.b + 1) < x.a * (y.b + 1);
}

LL dp[200005][35];

int main(){
	LL n,T,st,ans = 0;
	cin >> n >> T;
	for(LL i = 1;i <= n;i ++) cin >> s[i].a >> s[i].b;
	st = n + 1; sort(s + 1,s + 1 + n,cmp);
	for(LL i = n;i >= 1;i --) if(s[i].a == 0) st = i;
	
	for(LL i = 0;i <= 31;i ++) dp[0][i] = T + 1;
	dp[0][0] = 0;
	for(LL i = 1;i < st;i ++){
		dp[i][0] = dp[i - 1][0];
		for(LL j = 1;j <= 31;j ++){
			dp[i][j] = min(dp[i - 1][j],(1 + dp[i - 1][j - 1]) * (1 + s[i].a) + s[i].b);
			dp[i][j] = min(dp[i][j],T + 1);
		}
	}
	for(LL j = 0;j <= 31;j ++){
		LL tt = dp[st - 1][j];
		if(tt > T) continue;
		ans = max(ans,j);
		for(LL k = st;k <= n;k ++){
			if(tt + s[k].b + 1 > T) break;
			ans = max(ans,(k - st + j + 1));
			tt += (s[k].b + 1);
		}
	}
	cout << ans << endl;
	return 0;
}