#include <bits/stdc++.h>
template <typename T>
constexpr T INF() { return std::numeric_limits<T>::max() / 2; }
int main()
{
    int N, W;
    std::cin >> N >> W;
    std::vector<int> v(N), w(N);
    for (int i = 0; i < N; i++) { std::cin >> v[i] >> w[i]; }
    constexpr int V = 100 * 100;
    std::vector<int> dp(V + 1, INF<int>());
    dp[0] = 0;
    for (int i = 0; i < N; i++) {
        for (int j = V - v[i]; j >= 0; j--) { dp[j + v[i]] = std::min(dp[j + v[i]], dp[j] + w[i]); }
    }
    for (int i = V; i >= 0; i--) {
        if (dp[i] <= W) { return std::cout << i << std::endl, 0; }
    }
    return 0;
}
