#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = ((B)-1); I >= (A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;
#define pri(a) cout << (a) << endl

template <typename T>
struct Knap_Big_Weight{
	T W;
	int N,max_v;
	vector<int> v;
	vector<T> w;
	vector< vector<T> > dp;
	Knap_Big_Weight(int N_, T W_ ,int max_v_){
		W = W_;
		N = N_;
		max_v = max_v_;
		v.resize(N);
		w.resize(N);
		dp = vector< vector<T> >(2,vector<T>(max_v*N+1,W+1));
	}
	int calc(){
		dp[0][0] = dp[1][0] = 0;
		for(int i=1;i<=N;i++){
			for(int j=0;j<=N*max_v;j++){
				int k = i%2;
				int l = 1-k;
				if(j<v[i-1]){
					dp[k][j] = dp[l][j];
				}else{
					dp[k][j] = min(dp[l][j],dp[l][j-v[i-1]]+w[i-1]);
				}
			}
		}
		int k = N%2;
		for(int i=N*max_v;i>=0;i--){
			if(dp[k][i] < W+1){
				return i;
			}
		}
	}
};







int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll N,W;
	cin >> N >> W;
	Knap_Big_Weight<ll> kbw(N,W,100);
	FOR(i,0,N){
		cin >> kbw.v[i] >> kbw.w[i];
	}
	cout << kbw.calc() << endl;
}
