#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
    int n,c;
    scanf("%d%d",&n,&c);
    const int m=1e5+1,inf=1e9+1;
    vector<ll> x(m,inf);
    x[0]=0;
    while(n--)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        for(int i=m-1;i>=b;--i)
            x[i]=min(x[i],x[i-b]+a);
    }
    ll res=0;
    for(int i=0;i<m;++i)
        res=x[i]<=c?i:res;
    printf("%lld\n",res);
}
