// Original C++ solution (slower):
    #include <bits/stdc++.h> 

    using namespace std; 

    #define pb          push_back

    #define pf          push_front

    #define eb          emplace_back

    #define mp          make_pair

    #define ff          first

    #define ss          second

    #define popf()      pop_front()

    #define popb()      pop_back()

    #define ll          int64_t

    #define lli         long long int

    #define ld          long double

    #define mod         1000000007

    #define inf         1000000000000007

    #define ninf        -1000000000000007

    #define minf        1000000000000000007

    #define nl          cout<<"\n"

    #define dbg         cout<<"debug\n"

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

    #define iter(it,v)  for(auto it=v.begin();it!=v.end();++it)

    #define riter(it,v) for(auto it=v.rbegin();it!=v.rend();++it)

    #define forn(i,a,b) for(int64_t i=int64_t(a);i<int64_t(b);++i)

    #define forb(i,a,b) for(int64_t i=int64_t(a);i>=int64_t(b);--i)

    #define fastio()    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); 



    //-------------------------------L_I_Erq34-------------------------------



    const ll MAXN=107,MAXL=100007;

    ll dp[MAXN][MAXL];

    vector<pair<ll,ll>> v;



    bool comparell(pair<ll,ll> a,pair<ll,ll> b)

    {

        if(a.ff==b.ff)

            return a.ss>b.ss;

        return a.ff<b.ff;

    }



    int main()

    {

        ll n,t,i,w,a,b,j,k,z,m;

        cin>>n>>w;

        k=0;

        forn(i,0,n)

        {

            cin>>a>>b;

            v.pb(mp(a,b));

            k+=b;

        }

        forn(i,0,n+1)

            forn(j,0,k+7)

                dp[i][j]=inf;

        sort(all(v),comparell);

        m=0;

        dp[0][0]=0;

        forn(i,1,n+1)

        {

            forn(j,v[i-1].ss,k+7)

                dp[i][j]=min(dp[i][j],dp[i-1][j-v[i-1].ss]+v[i-1].ff);

            forn(j,0,MAXL)

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

        }

        forn(i,0,n+1)

            forn(j,0,k+7)

            {

                //cout<<i<<" "<<j<<" "<<dp[i][j]<<"\n";

                if(dp[i][j]<=w)

                    m=max(j,m);

            }

        cout<<m<<"\n";

        return 0;

    }

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;

using namespace __gnu_pbds; 

#define pb          push_back

#define ff          first

#define ss          second

#define ll          int64_t

#define ld          long double

#define mod         1000000007

#define mod2        998244353

#define inf         1000000000000007

#define pi          3.14159265358979323846

#define nl          cout<<"\n"

#define dbg(x)      cerr<<#x<<" = "<<x<<"\n"

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

#define forn(i,a,b) for(int64_t i=int64_t(a);i<int64_t(b);++i)

#define forb(i,a,b) for(int64_t i=int64_t(a);i>=int64_t(b);--i)

#define fastio()    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



template<typename T,typename U> static inline void amin(T &x,U y)   {if(y<x)x=y;}

template<typename T,typename U> static inline void amax(T &x,U y)   {if(x<y)x=y;}  



ll lcm(ll a,ll b)       {return (a*b)/__gcd(a,b);} 

ll count_digits(ll n)   {ll dig=floor(log10(n)+1);return dig;}

ll mpow(ll x,ll y,ll p) {ll r=1;x=x%p;while(y>0){if(y&1)r=(r*x)%p;y=y>>1;x=(x*x)%p;}return r;} 

string dec_bin_32(ll n) {string s;for(ll i=31;i>=0;i--){ll k=n>>i;s+=(k&1)?'1':'0';}return s;} 

string dec_bin_64(ll n) {string s;for(ll i=63;i>=0;i--){ll k=n>>i;s+=(k&1)?'1':'0';}return s;} 

ll mod_inv(ll a,ll m)   {ll m0=m,y=0,x=1;if(m==1)return 0;while(a>1){ll q=a/m,t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0)x+=m0;return x;} 



//-------------------------------L_I_Erq34-------------------------------



vector<ll> dp(100007,inf);



int main()

{

	fastio();

	ll z,n,m,t,k,i,j,l,d,h,r;

	cin>>n>>k;

	pair<ll,ll> a[n];

	forn(i,0,n)

		cin>>a[i].ff>>a[i].ss;

	dp[0]=0;

	forn(i,0,n)

		forb(j,100000,a[i].ss)

			dp[j]=min(dp[j],dp[j-a[i].ss]+a[i].ff);

	z=0;

	forb(i,100000,0)

		if(dp[i]<=k)

		{

			z=i;

			break;

		}

	cout<<z<<"\n";

	cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms\n";

	return 0;

}


// Fastest known solution for this problem: