#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,W; cin>>n>>W;
vector <int> v(n),w(n);
for(int i=0; i<n; i++){
cin>>v[i]>>w[i];
}
int dp[101][100005];
// memset(dp, 0, sizeof(dp));
for (int i=0; i<101; i++){
for (int j=0; j<100005; j++){
dp[i][j] = 1e9;
}
}
dp[0][0] = 0;
for (int i=0; i<n; i++){
for (int j=0; j<100002; j++){
if (j+v[i] < 100004){
dp[i+1][j+v[i]] = min(dp[i][j]+w[i], dp[i+1][j+v[i]]);
dp[i+1][j] = min(dp[i+1][j], dp[i][j]);
}
}
}
int ans = 0;
for (int j=0; j<100004; j++){
if (dp[n][j] <= W){
ans = max(ans, j);
}
}
cout<<ans<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJaW50IG4sVzsgY2luPj5uPj5XOwoJdmVjdG9yIDxpbnQ+IHYobiksdyhuKTsKCQoJZm9yKGludCBpPTA7IGk8bjsgaSsrKXsKCQljaW4+PnZbaV0+PndbaV07Cgl9CglpbnQgZHBbMTAxXVsxMDAwMDVdOwoJLy8gbWVtc2V0KGRwLCAwLCBzaXplb2YoZHApKTsKCWZvciAoaW50IGk9MDsgaTwxMDE7IGkrKyl7CgkJZm9yIChpbnQgaj0wOyBqPDEwMDAwNTsgaisrKXsKCQkJZHBbaV1bal0gPSAxZTk7CgkJfQoJfQoJCglkcFswXVswXSA9IDA7CgkKCWZvciAoaW50IGk9MDsgaTxuOyBpKyspewoJCWZvciAoaW50IGo9MDsgajwxMDAwMDI7IGorKyl7CgkJCWlmIChqK3ZbaV0gPCAxMDAwMDQpewoJCQkJZHBbaSsxXVtqK3ZbaV1dID0gbWluKGRwW2ldW2pdK3dbaV0sIGRwW2krMV1bait2W2ldXSk7CgkJCQlkcFtpKzFdW2pdID0gbWluKGRwW2krMV1bal0sIGRwW2ldW2pdKTsKCQkJfQoJCX0KCX0KCWludCBhbnMgPSAwOwoJZm9yIChpbnQgaj0wOyBqPDEwMDAwNDsgaisrKXsKCQlpZiAoZHBbbl1bal0gPD0gVyl7CgkJCWFucyA9IG1heChhbnMsIGopOwoJCX0KCX0KCQoJY291dDw8YW5zPDxlbmRsOwoJcmV0dXJuIDA7Cn0=