// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



#define all(v)				((v).begin()), ((v).end())

#define allr(v)				((v).rbegin()), ((v).rend())

#define sz(v)				((int)((v).size()))

#define ll long long

#define pb					push_back

#define fIO ios_base::sync_with_stdio(0);cin.tie(0);



const ll oo = 1e8;

const double pi = 3.1415926535897;





const double EPS = (1e-7);

int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}





typedef vector<int>                vi;

typedef vector<pair<int,int>>      vii;

typedef vector<ll>                 vll;

typedef vector<double>             vd;

typedef vector< vi >               vvi;

typedef vector< vd >               vvd;

typedef vector<string>             vs;

typedef pair<int, int>             pii;



/**

    * PLEASEEE READDD PROBLEEEM CARFULLY ****

    * Always check for OVERFLOW ll vs int

    * Always check for array bounds

    * Check for function return

    * READ OUTPUT SECTION AGAIN!!!

**/



struct edge{

    int from, to, w;



    edge(){}

    edge(int x, int y, int we): from(x), to(y), w(we){}



    bool operator < (const edge &rhs) const{

        return w > rhs.w;

    }



};



const int N = 100 + 5, V = 1e5 + 5 ;



int dp[V];

int w[N], v[N];

int n, ans = 0;

//

//int sol(int i, int vS, int wS) {

//    if(i == n) {

//        ans = max(ans, vS);

//        return 0;

//    }

//

//    int &ret = dp[i][vS];

//    if(ret != -1) return ret;

//

//    ret = sol(i + 1, vS, wS);

//

//    if(wS - w[i] >= 0) ret = max(ret, sol(i + 1, vS + v[i], wS - w[i]));

//

//    return ret;

//}



int main(){

    fIO



//    freopen("", "r", stdin);

//    freopen("", "w", stdout);



    fill(dp, dp + V, 1e9 + 5);



    int cap;

    cin >> n >> cap;



    for(int i = 0; i < n; i++) cin >> w[i] >> v[i];



    dp[0] = 0;

    for(int i = 0; i < n; i++) {

        for(int j = V - 5; j >= 1; j--) {

            if(j >= v[i]) {

               dp[j] = min(dp[j], dp[j - v[i]] + w[i]);

            }

        }

    }





    for(int i = V - 5; i >= 1; i--) {

        if(dp[i] <= cap) {

            cout << i << "\n";

            break;

        }

    }

}
















// Faster C++ solution for the same problem (measured speedup: 2.221012800190634x):
#include <bits/stdc++.h>

#define endl '\n'

#define ll long long

using namespace std;



const int INF = 1e9 + 5;

const int MXN = 110;

const int MXV = 100010;

int n, k;

int v[MXN], w[MXN];

ll dp[MXN][MXV];



int main() {

    ios_base::sync_with_stdio(false); cin.tie(NULL);

    cin >> n >> k;

    int sv = 0;

    for(int i = 0; i < n; i++) {

        cin >> w[i] >> v[i];

        sv += v[i];

    }

    for(int i = 0; i <= n; i++) 

        for(int j = 0; j <= sv; j++) 

            dp[i][j] = INF;

    dp[n][0] = 0;

    for(int i = n - 1; i >= 0; i--) {

        for(int j = 0; j <= sv; j++) {

            dp[i][j] = dp[i + 1][j];

            if(j - v[i] >= 0)

                dp[i][j] = min(dp[i][j], dp[i + 1][j - v[i]] + w[i]);

        }

    }

    ll ans = 0;

    for(int i = 0; i <= sv; i++) {

        if(dp[0][i] <= k)

            ans = max(ans, (ll)i);

    }

    cout << ans << endl;

    return 0;

}