#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7,INF=1e18;
#define ll long long
#define pll pair<ll,ll>
#define x first
#define y second
#define p_all(arr) for(auto i:arr){cout<<i<<" ";}cout<<"\n";
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    ll t=1;
    // cin>>t;
    while(t--)
    {
        ll n,s;
        cin>>n>>s;
        s*=100;
        ll sum=0;
        ll flag=-1;
        for(int i=0;i<n;i++)
        {
            ll u,v;
            cin>>u>>v;
            sum+=u*v;
            if(flag==-1&&sum>s)
            flag=i+1;
        }
        cout<<flag<<"\n";
    }
    return 0;
}
#include <vector>
#include <string>
#include <iostream>
using namespace std;
int main(void)
{
	long long n;
	cin >> n;
	long long sum = 0;
	vector<long long>a(n), b(n);
	for (long long i = 0; i < n; i++) {
		cin >> a.at(i) >> b.at(i);
		sum += b.at(i)*(b.at(i) + 1) / 2 - a.at(i)*(a.at(i) - 1) / 2;
	}
	cout << sum << endl;
}