#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n; ll x; cin >> n >> x;
  vector<ll> A(n); rep(i, n) cin >> A[i];
  vector<ll> cnt(n);
  {
    ll rem = x;
    rep(i, n) {
      if(i == n-1) cnt[i] = rem / A[i];
      else cnt[i] = (x % A[i+1]) / A[i];
    }
  }
  vector<vector<ll>> dp(n, vector<ll>(2));
  dp[0][0] = 1;
  rep(i, n-1) {
    if(cnt[i]) {
      dp[i+1][0] += dp[i][0];
      dp[i+1][1] += dp[i][0];
    } else {
      dp[i+1][0] += dp[i][0];
    }
    if(cnt[i]+1 < A[i+1]/A[i]) {
      dp[i+1][0] += dp[i][1];
      dp[i+1][1] += dp[i][1];
    } else {
      dp[i+1][1] += dp[i][1];
    }
  }
  cout << dp[n-1][0] + dp[n-1][1] << endk;
  return 0;
}

#ifdef __LOCAL
  #define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b) {if(a<b) {a=b; return true;} return false;}
template<typename T> bool chmin(T &a,T b) {if(a>b) {a=b; return true;} return false;}
#define itn int
#define fi first
#define se second
#define intmax numeric_limits<int>::max()
#define llmax numeric_limits<ll>::max()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>=1;i--)
#define all(vec) vec.begin(),vec.end()
#define fsort(vec) sort((vec).begin(),(vec).end())
#define rsort(vec) sort((vec).rbegin(), (vec).rend())
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;
const ll lnf=1ll<<60;

int main(){
  ll n; cin >> n;
  vector<ll> a(n);
  vector<ll> b(n);
  vector<ll> c(n);
  ll sum=0;
  rep(i,n){
    cin >> a[i] >> b[i];
    c[i]=2*a[i]+b[i];
    sum-=a[i];
  }
  rsort(c);
  rep(i,n){
    sum+=c[i];
    if(sum>0){
      //cout << sum << endl;
      cout << i+1 << endl;
      return 0;
    }
  }
  
}