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

constexpr int INF = (1 << 30);
constexpr int MAX = 10010;

void chmin (int &a, int b) {
	if (a > b) a = b;
}

int main() {
	int n, max_w;
	cin >> n >> max_w;
	vector<int> v(n), w(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i] >> w[i];
	}
	
	vector<int> dp(MAX, INF);
	dp[0] = 0;
	
	for (int i = 0; i < n; i++) {
		for (int sum_v = MAX; sum_v--> 0;) {
			chmin(dp[sum_v + v[i]], dp[sum_v] + w[i]);
		}
	}
	
	int max_v = 0;
	for (int sum_v = 0; sum_v < MAX; sum_v++) {
		if (dp[sum_v] <= max_w) max_v = sum_v;
	}
	
	cout << max_v << '\n';
	
	return 0;
}
