#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const int INF = 2000000000;
using namespace std;

int main(){
    int N, W;
    int v[101], w[101], dp[10005];
    fill(dp, dp + 10005, INF);
    dp[0] = 0;

    cin >> N >> W;
    rep(i,N) cin >> v[i] >> w[i];

    rep(i,N){
        for(int j = 10005 - 1; j >= 0; j--){
            if(j - v[i] >= 0) dp[j] = min(dp[j], dp[j - v[i]] + w[i]);
        }
    }

    int ans = 0;
    rep(i,10005) if(dp[i] <= W) ans = max(ans, i);
    cout << ans << endl;
}