#include <bits/stdc++.h>

#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end();
#define sz(x) (int)(x).size()
#define FOR_(i, a, b, s) \
  for (int i = (a); (s) > 0 ? i < (b) : i > (b); i += (s))
#define FOR1(n) FOR_(i, 0, n, 1)
#define FOR2(i, n) FOR_(i, 0, n, 1)
#define FOR3(i, a, b) FOR_(i, a, b, 1)
#define GET5(_1, _2, _3, _4, _5, ...) _5
#define FOR(...) GET5(__VA_ARGS__, FOR_, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define each(x, a) for (auto&& x : a)

using namespace std;

using ll = long long;
using ld = long double;
template <typename A>
using vt = vector<A>;

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) { return '"' + s + '"'; }

string to_string(const char* s) { return to_string((string)s); }

string to_string(bool b) { return (b ? "true" : "false"); }

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) void()
#endif

constexpr int MX = 200005;
constexpr int INF = 1000000202;
constexpr ll LINF = 1000000000000000202LL;
constexpr ll MOD = 1000000007;  // 998244353;
constexpr ld PI = 3.1415926535897932384626433832795029L;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, w_max;
  cin >> n >> w_max;
  vt<ll> w(n), v(n);
  FOR(n) { cin >> w[i] >> v[i]; }
  vt<vt<ll>> dp(110, vt<ll>(MX, INF));
  dp[0][0] = 0;
  FOR(n) {
    FOR(j, MX) {
      if (j - v[i] >= 0)
        dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i]);
      else
        dp[i + 1][j] = dp[i][j];
      // debug(i + 1, j, dp[i + 1][j]);
    }
  }
  int ans = 0;
  FOR(MX) {
    if (dp[n][i] <= w_max) ans = i;
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 176916