// Slower C++ solution:
#include<set>

#include<map>

#include<cmath>

#include<ctime>

#include<queue>

#include<stack>

#include<cstdio>

#include<string>

#include<vector>

#include<random>

#include<cstdlib>

#include<cstring>

#include<iomanip>

#include<iostream>

#include<algorithm>

#include<unordered_map>

#define endl "\n"

#define fi first

#define se second

#define db double

#define gcd __gcd

#define pb push_back

#define mp make_pair

#define lowbit(x) (x & (-x))

#define PII  pair<int, int> 

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

#define debug(x) cout << #x << " = " << x << endl

#define rep(i, a, b) for(__typeof(b) i = a; i <= (b); i++)

#define Rep(i, a, b) for(__typeof(a) i = a; i >= (b); i--)

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

template<class T> inline T qmin(T a, T b) { return a < b ? a : b; }

template<class T> inline T qmax(T a, T b) { return a > b ? a : b; }

typedef long long ll;

typedef unsigned long long ull;

const db eps = 1e-9;

const db PI = acos(-1);

const int inf = 0x3f3f3f3f;

const int mod = (int)1e9 + 7;

const int maxn = (int)1e5 + 5;//remember to modify it, No RE or MLE

const ll INF = 0x3f3f3f3f3f3f3f3f;

using namespace std;

ll qpow(ll x, ll y) { ll ret = 1; for( ; y; y >>= 1, x = (x * x) % mod) if(y & 1) ret = (ret * x) % mod; return ret; }



inline int read(){

	char ch = getchar();

	int x = 0, f = 1;

	while(ch < '0' || ch > '9'){

		if(ch == '-') f = -1;

		ch = getchar();

	}

	while('0' <= ch && ch <= '9'){

		x = x * 10 + ch - '0';

		ch = getchar();

	}

	return x * f;

}



int n, W;

int w[105], v[105];

ll dp[maxn];



int main()

{

	n = read(), W = read();

	rep(i, 1, n) w[i] = read(), v[i] = read();

	memset(dp, 0x3f, sizeof dp);

	dp[0] = 0;

	rep(i, 1, n){

		Rep(j, maxn - 1, v[i]){

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

		}

	}

	Rep(i, maxn - 1, 0){

		if(dp[i] <= W) return 0 * printf("%d\n", i);

	}

	return 0;

}

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

#define int long long

#define ll long long

#define ld long double

#define mod ((ll)1e9+7)

#define maxx ((ll)1e6+5)

#define pb push_back

#define ins insert

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

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

#define test ll t; cin>>t; while(t--)

ll exp(ll x,ll y,ll p){ ll res=1; while(y) {if(y%2) res=(res*x%p)%p; x=(x*x)%p; y/=2; } return res;}

ll expo(ll x,ll y){ ll res=1; while(y) {if(y%2) res=(res*x%mod)%mod; x=(x*x)%mod; y/=2; } return res;}

using namespace std;//ok i saw

signed main()

{

    int n,W,i,j,k;

    cin >> n >> W;

    int w[n+1],v[n+1],maxv=0;

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

    {

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

    	maxv =max(maxv , v[i]);

    }

    int d[n+1][maxv*n +1];

    int col = maxv*n;

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

		for(j=0 ; j<=col ; j++)

			d[i][j] = -1;

	for(i=1 ; i<=col ; i++)

		d[0][i] = -1;

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

		d[i][0] = 0;

	int ans = 0;

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

	{

		for(j=1 ; j<=col ; j++)

		{

			if(v[i] <= j && (d[i-1][j-v[i]] != -1 ))

				d[i][j] = w[i] + d[i-1][j-v[i]];

			if(d[i-1][j] != -1 && d[i][j] != -1)

				d[i][j] = min(d[i-1][j] , d[i][j]);

			else if(d[i-1][j] != -1 ) 

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

			if(d[i][j] >= 0 && d[i][j] <= W)

				ans = max(ans,j);

				//cout<<d[i][j]<<" ";

		}//cout<<"\n";

	}

	cout << ans <<"\n";

    return 0;

}