// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



using ll = long long;



//constant

const ll MOD = 1e+9 + 7;

const double EPS = 1e-10;



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

#define FOR(i, s, e) for (ll i = s; i < e; i++)

#define ALL(x) (x).begin(),(x).end()

#define RALL(x) (x).rbegin(), (x).rend()



//debug

#define DUMP(x)  cerr << #x << " = " << (x) << endl;

#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;



// view vector

template<typename T> void view(T e) { std::cout << e << std::endl; }

template<typename T> void view(const std::vector<T>& v) { for (const auto& e : v) { std::cout << e << " "; } std::cout << std::endl; }

template<typename T> void view(const std::vector<std::vector<T> >& vv) { for (const auto& v : vv) { view(v); } }





// ***************************************



int main(void) {



	ll N, W;

	cin >> N >> W;



	vector<vector<ll>> dp(N + 1);

	fill(dp.begin(), dp.end(), vector<ll>(1e3 * N + 1, W * N * 1e5));

	dp[0][0] = 0;



	vector<pair<ll, ll>> wv(N);



	for (auto& p : wv) {

		cin >> p.first >> p.second;

	}

	

	REP(i, N) {

		ll w = wv[i].first;

		ll v = wv[i].second;

		REP(j, 1e3 * N + 1) {

			if (j - v >= 0) {

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

			}

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

		}

	}



	ll ans = 0;

	for (ll i = 1e3 * N; i >= 0; i--) {

		if (dp[N][i] <= W) {

			ans = i;

			break;

		}

	}



	cout << ans << endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.423247498890268x):
#ifdef _MSC_VER

#include "stdc++.h"

#endif

#ifdef __GNUC__

#include<bits/stdc++.h>

#endif

using namespace std;



using ll = long long;



//constant

const double EPS = 1e-10;

ll MOD = 1000000007;



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

#define FOR(i, s, e) for (ll i = s; i < e; i++)

#define ALL(x) (x).begin(),(x).end()

#define RALL(x) (x).rbegin(), (x).rend()



//debug

#define DUMP(x)  cerr << #x << " = " << (x) << endl;

#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;



// vector

//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }



// view vector

template<typename T> void view(T e) { cout << e << endl; }

template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }

template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

template<typename T> void view2d(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }



// DP

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }

template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }



// ***************************************



int main(void) {



	ll N, W;

	cin >> N >> W;



	vector<pair<ll, ll>> item(N);

	ll V = 0;

	for (auto& x : item) {

		cin >> x.first >> x.second;

		V += x.second;

	}



	vector<vector<ll>> dp(N + 1, vector<ll>(V + 1, 1e13));

	for (auto& x : dp) {

		x[0] = 0;

	}



	REP(i, N) {

		ll w = item[i].first;

		ll v = item[i].second;

		FOR(j, 1, V + 1) {

			if (j - v >= 0) {

				chmin(dp[i + 1][j], dp[i][j - v] + w);

				//DEBUG(dp[i + 1][j]);

			}

			chmin(dp[i + 1][j], dp[i][j]);

		}

	}



	for (ll x = V; x >= 0; x--) {

		if (dp[N][x] <= W) {

			cout << x << endl;

			break;

		}

	}



	return 0;

}