#include <bits/stdc++.h>
using namespace std;


struct Knap{
    long long wt;
    long long val;
}G[110];

bool cmp(Knap &a , Knap &b){
    if(a.val == b.val)
        return a.wt < b.wt;
    return a.wt > b.wt;
}

void Knapsack(long long n , long long w , long long sum){
    int i , j;
    long long k[sum+3];
    for(i=0;i<=sum;i++)k[i] = INT_MAX;
    k[0] = 0;
    for(i=0;i<=n;i++){
        for(j=sum-G[i].val;j>=0;--j){
            k[j+G[i].val] = min(k[j+G[i].val],k[j]+G[i].wt);
        }
    }
    long long ans = 0;
    for(long long f=0;f <= sum;++f){
        if(k[f]<=w)ans = max(ans,f);
    }
    cout<<ans<<endl;
}

int main(){
    //freopen("riyad.txt","r",stdin);
    long long sum , i , n , w;
    sum = 0;
    cin>>n>>w;
    for(i=0;i<n;i++)
        scanf("%lld %lld",&G[i].wt ,&G[i].val),sum+=G[i].val;
    sort(G,G+n,cmp);//sorting val/weight in ascending order
    Knapsack(n,w,sum);
    return 0;
}

