
/*
TASK: lift
LANG: C++
*/

#include <iostream>

using namespace std;

#define MAXN 16

int n, t;

int main()
{
    int s, i;
    cin >> n >> t;
    
    for( i = 0; i < n; i++ ) {
         int a, b;
         cin >> a >> b;
         
         s += a;

         
         if( b > t ) {
              cout << "0\n";
              break;
         }
   }
   
   cout << s << "\n";
   
   return 0;
}
   
         
         
    
