#include <bits/stdc++.h>
using namespace std;
const long long mx = 1e5 + 1, inf = 1e10;
long long n, w[101], v[101], W, dp[101][mx + 10], ps[10001], ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> W;
  for (long long i = 1; i <= n; i++) {
    cin >> w[i] >> v[i];
  }
  for (long long i = 1; i <= n; i++) {
    ps[i] = ps[i - 1] + v[i];
  }
  for (long long i = 0; i <= n; i++)
    for (long long j = 0; j <= mx; j++) dp[i][j] = inf;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= ps[i]; j++) {
      dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - v[i]] + w[i]);
    }
  }
  for (long long i = 0; i <= n; i++) {
    for (long long j = 0; j <= mx; j++) {
      if (dp[i][j] <= W) ans = max(ans, j);
    }
  }
  cout << ++ans;
}
