// Slower C++ solution:
/**       In the name of Allah, the Gracious, the Merciful.

*               Praise be to Allah, Lord of the Worlds.

*               **************************************

*

*    I have not failed, I have just found 1000 WAYS that won't work.

*                 __________________________________

*                  Author  : Abd El-Twab  M. Fakhry

*                 __________________________________

*/



#include <ext/rope>

#include <bits/stdc++.h>

#include <ext/pb_ds/tree_policy.hpp>

#include <ext/pb_ds/assoc_container.hpp>



#define  print(arr, l, r)    for(int i = (l); i < (r); cout << arr[i++] << " \n"[i == r])

#define  read(arr, l, r)     for(int i = (l); i < (r); cin >> arr[i++])

#define  repr(i, r, l)       for (int i = r; i > l; i--)

#define  rep(i, l, r)        for (int i = l; i < r; i++)

#define  Unique(n)           (n).erase(unique(all(n)), (n).end())

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

#define  RT(n)               return cout << (n) << endl, 0;

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

#define  endl                '\n'

#define  D(x)                cout << #x << " = " << (x) << '\n'

#define  F                   first

#define  S                   second

#define  PB                  push_back

#define  EB                  emplace_back

#define  lsb(x)              (x & -x)

#define  get(n)              find_by_order(n)

#define  sqrt(n)             sqrtl(n)

#define  pow(a, b)           powl(a, b)

#define  indexOf(n)          order_of_key(n)

#define  isPowerOfTwo(x)     (x && !(x & (x - 1)))



using namespace std;

using namespace __gnu_pbds;

using namespace __gnu_cxx;



typedef long long            ll;

typedef unsigned long long   ull;



/**---------------------->>  Constants  <<-----------------------**/



const double    Pi      = 2 * acos(0.0),    Euler = 2.71828182845904523536,

                Epsln   = 1e-9,           GoldenR = (1 + sqrtl(5.0)) / 2;



const ll        MgcPrim = 2305843009213693951;

const int       MxsZ    = (int)1e5 + 9,        oo = 0x3f3f3f3f,

 		        ModB2   = (1 << 30) + 7,   ModBT7 = (int)1e9 + 7, ModBT = (int)1e9;



/**---------------->>  Functions & Shortcuts  <<-----------------**/



template <class T>

T Gcd(T a, T b) { return b ? Gcd(b, a % b) : a; }



template <class T>

T Lcm(T a, T b) { return a / Gcd(a, b) * 1ll * b; }



template <class T> /** Phi(a * b) = Phi(a) * Phi(b) where a and b Prime Factors and k their power **/

T Phi(T a, T k) { return pow(a, k - 1) * (a - 1); }



template <class T>

using indexed_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update >;



template <class T>

using matrix = vector < vector <T> >;



template <class T>

using min_heap = priority_queue < T, vector <T>, greater <T> >;



/** Watch **/



template <class T>

string ToString(T x) { stringstream sout; sout << x; return sout.str(); }



#ifdef BFS

int dx8[8] = { 1, -1, 0, 0, 1, 1, -1, -1 }, dx4[4] = { 0, 0, 1,-1};

int dy8[8] = { 0, 0, 1, -1, 1, -1, 1, -1 }, dy4[4] = { 1,-1, 0, 0};

#endif // BFS



/**------------------>>  Fast input / output  <<-----------------**/



void Fast()

{

    cin.sync_with_stdio(0);

    cin.tie(0);cout.tie(0);

    cin.exceptions(cin.failbit);

}



/**----------------->>  input / output Files  <<-----------------**/



void File()

{

    #ifdef FIO

    freopen("input.in", "r", stdin);

    freopen("output.out", "w", stdout);

   	#endif // FIO

}



/**------------------>>  Initialization gap  <<------------------**/



int n, W;

pair <int, int> a[101];

ll ans = 0, dp[MxsZ];



inline void Solve()

{

    cin >> n >> W;



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

        cin >> a[i].first >> a[i].second;



    fill(dp, dp + MxsZ, oo); dp[0] = 0;



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

        for(int j = MxsZ - a[i].second; j >= 0; --j)

            dp[j + a[i].second] = min(dp[j + a[i].second], dp[j] + a[i].first);



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

        if(dp[i] <= W) ans = max(ans, (ll)i);



    cout << ans << endl;

}



/**------------------------->>  Main  <<-------------------------**/



int main()

{

    Fast(); File(); Solve();

}


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

using namespace std;



typedef long long ll;

#define dbg(x) cout<<(#x)<<" is "<<x<<endl

ll dp[102][100009],wt[102],v[102];



ll knapsack(ll n,ll s,ll w)

{

    ll a,b;

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

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

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

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

            else if(v[i]>j){

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

            }

            else

            {

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

                b= dp[i-1][j-v[i]]==-1? -1:wt[i]+dp[i-1][j-v[i]];

                if(a==-1 && b==-1)

                {

                    dp[i][j]=-1;

                }

                else if(a==-1)

                {

                    dp[i][j]=b;

                }

                else if(b==-1){

                    dp[i][j]=a;

                }

                else{

                    dp[i][j]=min(a,b);

                }

            }

        }

        dp[0][0]=0;

    }

    

    for(int j=s; j>=0; j--){

        if(dp[n][j]<=w && dp[n][j]!=-1) return j;

    }

}

int main()

{

   ll n,w,i,s=0;

   scanf("%lld %lld",&n,&w);

   for(i=1; i<=n; i++){

        scanf("%lld %lld",&wt[i],&v[i]);    

        s+=v[i];

   }

 

   ll ans=knapsack(n,s,w);

   printf("%lld\n",ans);

   return 0;

}