#include<bits/stdc++.h>
#define ll long long
using namespace std;
int  main(){
	ll n,weight;
	cin>>n>>weight;
	ll w[109];
	ll v[109];
	int sum=0;
	for(int i=1;i<=n;i++){
		cin>>w[i]>>v[i];
		sum+=v[i];

	}
	ll dp[sum+1];
	fill(dp,dp+sum+1,1e9+9);
	dp[0]=0;
	for(int i=1;i<=n;i++){
		for(int j=sum;j>=v[i];j--){
			dp[j]=min(dp[j],dp[j-v[i]]+w[i]);
		}

	}
	ll ans=0;

	for(ll i=1;i<=sum;i++){
		if(dp[i]<=weight)
		ans=max(ans,i);
	}
	cout<<ans;

	return 0;

}