// Slower C++ solution:
																//  SMOKE SHISHA PLAY FIFA  // 

#include<bits/stdc++.h>

using namespace std;



typedef long long int ll;

typedef long double ld;



#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);

#define pll pair<ll,ll>

#define MP make_pair

#define ff first

#define ss second

#define PB push_back

#define mod 1000000007

#define lp(i,start,end) for(ll i=start;i<=end;i++) 

#define deb1(a) cout<<#a<<" = "<<(a)<<endl;

#define deb2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;

#define deb3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;





ll modu(ll a, ll b)

{

	ll ans =1;

	while(b>0)

	{

		if(b&1)

		ans = (ans*a)%mod;

		b/=2;

		a = (a*a)%mod;

	}

	return ans;

}



int main()

{

	fastio

	ll t=1;

	//cin >> t;

	while(t--)

	{

		ll n,wt,ma=0;

		cin>>n>>wt;

		ll w[n+1],v[n+1];

		lp(i,1,n){

			cin>>w[i]>>v[i];

			ma+=v[i];

		}

		ll dp[100000];

		dp[0]=0;

		lp(i,1,100000)

			dp[i]=1000000000007;

		for(ll j=1; j<=n; j++){

			for(ll i=ma; i>=v[j]; i--){

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

			}

	}

		ll ans=0;

		for(ll i=0; i<=100000; i++){

			if(dp[i]<=wt){

				ans=max(ans,i);

			}

		}

		cout<<ans<<endl;



	}

	return 0;	

}


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

#define FIN         ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

#define ii          pair<int,int>

#define F           first

#define S           second

#define pb          push_back

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

#define rall(x)     (x).rbegin(),(x).rend()

#define fore(i,a,b) for(int i = a;i < b; i+= 1)

#define forr(i,a)   for(int i = a; i >= 0; i--)

#define fori(i,m)   for(auto i = m.begin(); i != m.end(); i++) 

#define w(t)        while(t--)

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

#define cls(a,car)  memset(a,car,sizeof (a))

#define db(x)       cerr << #x << " is " << x << '\n'

#define FL          freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout);

#define EjecuteTime cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"

#define angle(x)    double(x * acos(-1) / 180.0)

using namespace std;

typedef long long   ll;

typedef vector<int> vi;

typedef vector<ii>  vii;

const int N = 1 * 1e5 + 5;

const ll mod = 1e9 + 7;

const double E = 1e-9;

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

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

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

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

// fflush(stdout)

// cout << flush

// a + b = a ^ b + 2 * (a & b)

int n, W;

ll w[101];

int v[101];

ll dp[2][N];

ll f(int i, int want){

    if(want < 0)return 1e18;

    if(i == n)return want == 0 ? 0 : 1e18;

    ll &ans = dp[i][want];

    if(ans == -1){

        ans = 1e18;

        ans = min(f(i + 1, want), ans);

        ans = min(ans, f(i + 1, want - v[i]) + w[i]);



    }return ans;

}

int main(){

    //FL;

    FIN;

    cin >> n >> W;

    // optimizando memoria

    int sum = 0;

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

        cin >> w[i] >> v[i];

        sum += v[i];

    }

    for(int i = n; i >= 0; i--){

        for(int want = 0; want <= sum; want++){// hast limite sumaMAx

            ll &ans = dp[i & 1][want];

            if(i == n){

                ans = want == 0 ? 0 : 1e18;

                continue;

            }

            ans = 1e18;

            ans = min(ans, dp[(i + 1) & 1][want]);

            if(want - v[i] >= 0)

                ans = min(ans, dp[(i + 1) & 1][want - v[i]] + w[i]);

        }

    }

    int ans = 0;

    for(int i = 0; i < sum + 1; i++){

        ll cur = dp[0 & 1][i];

        if(cur <= W)

            ans = i;

    }

    cout << ans << '\n';

    EjecuteTime;

    return 0;

}