// Original C++ solution (slower):
#include<bits/stdc++.h>

#define MOD 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);

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

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

#define mp make_pair

#define f first

#define s second

#define pb(x) push_back(x)

typedef  long long  int ll;

typedef std::vector<ll> vi;



#define input(vec,a,b) for(ll i =a;i<b;i++) cin>>vec[i]

#define print(vec,a,b) for(ll i=a;i<b;i++) cout<<vec[i]<<" " ;cout<<endl;

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

using namespace std;





void solve(){

        ll i,j , n,w,out;

        cin>>n>>w;

        ll we[n],v[n];

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

        {

                 cin>>we[i]>>v[i];

        }

        ll mv[n+1][100001]={0};

        bool p[n+1][100001]={0};

        

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

        {

                 mv[0][i]=0;

                 p[0][i]=0;

        }

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

        {

                 mv[i][0]=0;

                 p[i][0]=1;

        }

        

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

        {

                 for(j=0;j<v[i-1];j++)

                 {

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

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

                 }

                 for(j=v[i-1];j<=100000;j++)

                 {

                          if(p[i-1][j-v[i-1]])

                          {

                                   if(p[i-1][j])

                                   mv[i][j]=min(mv[i-1][j],mv[i-1][j-v[i-1]]+we[i-1]);

                                   else

                                   mv[i][j]=mv[i-1][j-v[i-1]]+we[i-1];

                                   p[i][j]=1;

                          }

                          else

                          {

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

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

                          }

                 }

        }

        out=0;

        for(i=100000;i>=0;i--)

        {

              if(p[n][i]&&mv[n][i]<=w)

              {

                       cout<<i;

                       return;

              }

        }

       

}



int main()

{

      IO;

      ll t=1;

      //cin>>t;





      while(t--)

      {



          solve();

      }

    return 0;

}

// Optimized solution to the same problem (faster):
//submitting previously written code, to keep track of my progress. 

#include <iostream>

#include <vector>

#include <cmath>

#include <set>

#include <queue>

#include <map>

#include <cstdio>

#include <cstring>

#include <string>

#include <stack>

#include <algorithm>

#include <limits.h>

#include <bits/stdc++.h>

#define fw(x) freopen("x.txt","w",stdout)

#define For(i,a,b,c) for(int i = a;i < b;i+=c)

#define REP(i,n) for(int i = 0;i < n;++i)

#define REP1(i,n) for(int i = 1; i<=n;i++)

#define mem(a,s) memset(a,s,sizeof a)

#define fast ios_base::sync_with_stdio(0);cin.tie(NULL)

#define pf printf

#define sc scanf

#define ll long long

#define pii pair<int,int>

#define pll pair<ll,ll>

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

#define vii vector<int>

#define vll vector<ll>

#define vss vector<string>

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

#define pb push_back





using namespace std;





// moves



//int dx[]= {0,0,1,-1};/*4 side move*/

//int dy[]= {-1,1,0,0};/*4 side move*/

//int dx[]= {1,1,0,-1,-1,-1,0,1};/*8 side move*/

//int dy[]= {0,1,1,1,0,-1,-1,-1};/*8 side move*/

//int dx[]={1,1,2,2,-1,-1,-2,-2};/*knight move*/

//int dy[]={2,-2,1,-1,2,-2,1,-1};/*knight move*/





//big_mod



//ll bigmod(ll a,ll b,ll m)

//{if(b == 0) return 1%m;ll x = bigmod(a,b/2,m);x = (x * x) % m;if(b % 2 == 1) x = (x * a)% m;return x;}

//ll BigMod(ll B,ll P,ll M){ ll R=1%M; while(P>0) {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} return R;} /// (B^P)%M



//ll getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1ll;}

//ll setBit1(ll num, int idx) {return num or (1ll<<idx);}

//ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}

//ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}



const int mod = 1000000007;



    int cost[101];

    int wt[101];

    ll dp[101][100001];

int main()

{

    fast;

    int n, w;

    cin>>n>>w;

    REP1(i, n) cin>>wt[i]>>cost[i];

    REP(i, n+1){

      REP(j, 100001){

        if(j==0) dp[i][j] = 0;

        else if(i==0) dp[i][j] = INT_MAX;

        else{

          if(j>=cost[i]) dp[i][j] = min(dp[i-1][j], dp[i-1][j-cost[i]] + wt[i]);

          else dp[i][j] = dp[i-1][j];

        }

      }

    }

    ll ans = 0;

    REP(i, 100001) if(dp[n][i]<=w) ans = i;

    cout<<ans<<'\n';

    return 0;

}

// Fastest known solution for this problem: