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

using namespace std;



#define rep(i, n) for (int i = 0; i < n; i++)

#define repr(i, n) for (int i = n-1; i >= 0; i--)

#define ALL(x) x.begin(),x.end()



using ll = long long;

using pii = pair<int, int>;

using vi = vector<int>;



const int mod = 1e9+7;

const int INF = 1e9+1;

const int MAX = 1e5;



// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};



struct edge {int to, cost;}; // 辺

// vector<edge> graph[MAX]; // 隣接リスト

// bool visit[MAX]; // 訪問の有無



int n, w; // 変数

struct item {int value, weight;};

item items[100];

int dp[100][MAX+1];

int ans = 0;



int dp_solve() {

    rep(i, n) {

        rep(j, MAX+1) {

            if (j == 0) dp[i][j] = 0;

            else dp[i][j] = INF;

        }

    }

    rep(i, n) {

        rep(j, MAX+1) {

            if (j == 0) continue;

            if (i == 0) {

                if (j == items[i].value && items[i].weight <= w) {

                    dp[i][j] = items[i].weight;

                }

            } else {

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

                if (j-items[i].value >= 0) {

                    int x = dp[i-1][j-items[i].value] + items[i].weight;

                    if (x <= w) {

                        dp[i][j] = min(dp[i][j], x);

                    }

                }

            }

        }

    }

    rep(i, MAX+1) {

        if (dp[n-1][i] == INF) continue;

        ans = max(ans, i);

    }

    return ans;

}



int main() {

// input

    cin >> n >> w;

    rep(i, n) {

        cin >> items[i].weight;

        cin >> items[i].value;

    }

// solve

    int ans = dp_solve();

// output

    cout << ans << "\n";

}

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

using namespace std;



#define rep(i, n) for (int i = 0; i < n; i++)

#define repr(i, n) for (int i = n-1; i >= 0; i--)

#define ALL(x) x.begin(),x.end()



using ll = long long;

using pii = pair<int, int>;

using vi = vector<int>;



const int mod = 1e9+7;

const int INF = 1e9+1;

const int MAX = 1e5;



// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};



struct edge {int to, cost;}; // 辺

// vector<edge> graph[MAX]; // 隣接リスト

// bool visit[MAX]; // 訪問の有無



int n, w; // 変数

struct item {int value, weight;};

item items[100];

int dp[100][MAX+1];



int dp_solve() {

    // rep(i, n) {

    //     rep(j, MAX+1) {

    //         if (j == 0) dp[i][j] = 0;

    //         else dp[i][j] = INF;

    //     }

    // }

    rep(i, n) {

        rep(j, MAX+1) {

            if (j == 0) continue;

            if (i == 0) {

                if (j == items[i].value && items[i].weight <= w) {

                    dp[i][j] = items[i].weight;

                } else {

                    dp[i][j] = INF;

                }

            } else {

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

                if (j-items[i].value >= 0) {

                    int x = dp[i-1][j-items[i].value] + items[i].weight;

                    if (x <= w) {

                        dp[i][j] = min(dp[i][j], x);

                    }

                }

            }

        }

    }

    repr(i, MAX+1) {

        if (dp[n-1][i] != INF) {

            return i;

        }

    }

    // rep(i, MAX+1) {

    //     if (dp[n-1][i] == INF) continue;

    //     ans = max(ans, i);

    // }

    // return ans;

    return 0;

}



int main() {

// input

    cin >> n >> w;

    rep(i, n) {

        cin >> items[i].weight;

        cin >> items[i].value;

    }

// solve

    int ans = dp_solve();

// output

    cout << ans << "\n";

}