// Slower C++ solution:
// {{{ Headers

// vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}}



#include <cassert>

#include <cctype>

#include <cmath>

#include <climits>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>



#include <algorithm>

#include <deque>

#include <functional>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>



#include <fstream>

#include <iostream>

#include <sstream>



using namespace std;

// }}}



typedef long long int64;

const int INF = 0x3f3f3f3f;

const int64 LINF = (int64) 1e15;

template <class T> inline int len (const T &a) { return a.size (); }

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



int64 dp [105][100 * 1000 + 5];

int v [100 * 1000 + 5];

int w [100 * 1000 + 5];

int N, W;



int

main () {

    scanf ("%d %d", &N, &W);

    for (int i = 0; i < N; i++) scanf ("%d %d", w + i, v + i);

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

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

            dp [i][j] = LINF;



    dp [0][0] = 0;

    for (int i = 1; i <= N; i++)

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

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

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

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

        }



    int ret = 0;

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

        if (dp [N][j] <= W)

            ret = max (ret, j);



    printf ("%d\n", ret);





#ifdef LOCALHOST

	cerr << "time: " << (int64) clock () * 1000 / CLOCKS_PER_SEC << " ms" << endl;

#endif

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.7104993347812703x):
// {{{ Headers

// vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}}



#include <cassert>

#include <cctype>

#include <cmath>

#include <climits>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>



#include <algorithm>

#include <deque>

#include <functional>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>



#include <fstream>

#include <iostream>

#include <sstream>



using namespace std;

// }}}



typedef long long int64;

const int INF = 0x3f3f3f3f;

const int64 LINF = (int64) 1e15;

template <class T> inline int len (const T &a) { return a.size (); }

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



int64 dp [100 * 1000 + 5];

int v [100 * 1000 + 5];

int w [100 * 1000 + 5];

int N, W;



int

main () {

    scanf ("%d %d", &N, &W);

    for (int i = 0; i < N; i++) scanf ("%d %d", w + i, v + i);

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

        dp [j] = LINF;



    dp [0] = 0;

    for (int i = 1; i <= N; i++)

        for (int j = 100000; j >= 0; j--)

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

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



    int ret = 0;

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

        if (dp [j] <= W)

            ret = max (ret, j);



    printf ("%d\n", ret);





#ifdef LOCALHOST

	cerr << "time: " << (int64) clock () * 1000 / CLOCKS_PER_SEC << " ms" << endl;

#endif

    return 0;

}