// Slower C++ solution:
//by Top1

#include <bits/stdc++.h>

     

#define f first

#define s second

#define int long long

#define ld long double

#define ull unsigned long long

#define pii pair <int, int>

#define pll pair <long, long>

#define mp make_pair

#define pb push_back

#define pf push_front

#define pp pop_back

#define rev reverse

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

#define sz(s) (int)s.size()

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

#define boost ios_base::sync_with_stdio(false); cin.tie(0),cout.tie(0);

#define nxtp next_permutation

#define pvtp prev_permutation

#define KZ return 

#define x1 x21212121

#define y1 y21212121

#define sqr(x) x * x 

 

const int inf = (1e9) + 1;

const int mod = 1e9 + 7;

const int maxn = 1e5 + 111;

     

using namespace std;



int q, n, w, a[maxn], b[maxn], dp[105][maxn], ans;



void solve(){    

	cin >> n >> w;



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

		cin >> a[i] >> b[i];



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

		for (int j = 1e5; j >= 0; j--)

			dp[i][j] = inf;



	dp[0][0] = 0;



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

		for (int j = 1e5; j >= 0; j--){

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

			if (j - b[i] >= 0)

				dp[i][j] = min(dp[i][j], dp[i - 1][j - b[i]] + a[i]);

			if (dp[i][j] <= w)

				ans = max(ans, j);

		}

		/*for (int j = 1; j <= 20; j++)

			cout << dp[i][j] << " ";

		cout << endl;	*/

		//cout << dp[i][100000] << endl;

	}



	//cout << dp[n][100000] << " ";



	/*for (int i = 0; i <= w; i++)

		cout << dp[i] << " ";

	*/

	cout << ans;

}



main(){

    boost;

	    

	q = 1;



	while (q--){

		solve();

	}

}

// Faster C++ solution for the same problem (measured speedup: 7.110919127483986x):
#include <bits/stdc++.h>

using namespace std;



#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>

void __f(const char* name, Arg1&& arg1) {

  cerr << name << " : " << arg1 << "\n";

}

template <typename Arg1, typename... Args>

void __f(const char* na, Arg1&& arg1, Args&&... args) {

  const char* c = strchr(na + 1, ',');

  cerr.write(na, c - na) << " : " << arg1 << " , ";

  __f(c + 1, args...);

}

#define endl "\n"

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

#define UNIQUE(v) sort(all(v)),v.erase(unique(all(v)),v.end())

typedef long long LL;

typedef pair <int,int> pii;

const double pi = acos(-1.0);

const double eps = 1e-8;

const int mod = 1e9 + 7;

const int inf = 1e9;

const LL INF = 1e18;

const int N = 1e5 + 5;



int main() {

  ios_base::sync_with_stdio(false);

  cin.tie(0); cout.tie(0);

  #ifdef LOCAL

    freopen("input.txt", "r", stdin);

  #endif // LOCAL

  int n, cap;

  cin >> n >> cap;

  vector <int> w (n + 1);

  vector <int> v (n + 1);

  int tot = 0;

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

    cin >> w[i] >> v[i];

    tot += v[i];

  }

  vector <vector <int> > dp (n + 5, vector <int> (tot + 5, inf));

  /// dp[i][j] = minimum capacity for which we can make j for upto i'th items

  for (int i = 0; i <= n; i++) dp[i][0] = 0;

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

    for (int j = 1; j <= tot; j++) {

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

      if (v[i] <= j) dp[i][j] = min(dp[i][j], dp[i - 1][j - v[i]] + w[i]);

    }

  }

  int mx = 0;

  for (int i = 0; i <= tot; i++) {

    if (dp[n][i] <= cap) mx = i;

  }

  cout << mx << endl;

  return 0;

}