#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;

void INX(){}
template<typename Head, typename... Tail>
void INX(Head&& head, Tail&&... tail)
{
    cin >> head;
    INX(forward<Tail>(tail)...);
}
void OUTX(){}
template<typename Head, typename... Tail>
void OUTX(Head&& head, Tail&&... tail)
{
    cout << head << endl;
    OUTX(forward<Tail>(tail)...);
}

#define ADD emplace_back
#define MP make_pair
#define VVEC(type) vector<vector<type>>
#define __LONG_LONG_MIN__ (-__LONG_LONG_MAX__ - 1)

//#define MOD 1000000007 // 10^9 + 7
//setprecision(10)

int main()
{
    ll N, X;
    INX(N, X);
    X *= 100;

    bool yotta = false;
    ll suma = 0;
    for (ll i = 1; i <= N; i++)
    {
        ll v,p;
        INX(v,p);
        
        suma += v * p;
        if(suma > X)
        {
            yotta = true;
            OUTX(i);
            break;
        }
    }

    if(!yotta)
    {
        OUTX(-1);
    }
    

    return 0;
}

#include <iostream>
#include <vector>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)

int main()
{
  string str;
  cin >> str;
  int ans = 0;
  rep(i,12){
    if(str.compare(i,4,"ZONe")==0){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}