"use strict";
function Main(input) {
    let lines = input.split("\n");
    let nw = lines.shift().split(/\s/).map((v) => v - 0);
    let N = nw[0] - 0, W = nw[1] - 0, V = 100000;
    let weight = new Array(N), value = new Array(N);
    for (let n = 0; n < N; n++) {
        let wv = lines.shift().split(/\s/).map((v) => v - 0);
        weight[n] = wv[0];
        value[n] = wv[1];
    }
    let dp = new Array(N + 1).fill(0).map(() => new Array(V + 1).fill(Number.MAX_SAFE_INTEGER));
    dp[0][0] = 0;
    for (let n = 0; n < N; n++) {
        for (let sum_v = 0; sum_v <= V; ++sum_v) {
            if (sum_v - value[n] >= 0) {
                dp[n + 1][sum_v] = Math.min(dp[n + 1][sum_v], dp[n][sum_v - value[n]] + weight[n]);
            }
            dp[n + 1][sum_v] = Math.min(dp[n + 1][sum_v], dp[n][sum_v]);
        }
    }
    let ans = 0;
    for (let sum_v = 0; sum_v <= V; ++sum_v) {
        if (dp[N][sum_v] <= W) ans = sum_v;
    }
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));