import std.stdio, std.array, std.conv, std.typecons, std.algorithm;

immutable INF = 1<<16;

long impl(long n, long v, const ref long[] ws, const ref long[] vs, ref long[][] dp) {
    if(dp[n][v] == INF) {
        if(n <= 0) {
            dp[n][v]--;
        } else {
            const auto yes = {
                const auto prev_v = v-vs[n-1];
                return prev_v >= 0 ? impl(n-1, prev_v, ws, vs, dp) + ws[n-1] : INF;
            }();
            const auto no = impl(n-1, v, ws, vs, dp);
            dp[n][v] = min(yes, no, dp[n][v]);
        }
    }
    return dp[n][v];
}

long solve(long n, long w, const ref long[] ws, const ref long[] vs) {
    long max_v;
    foreach(v ; vs) {
        max_v = max(v, max_v);
    }
    auto sumvmax = max_v*n;
    auto dp = new long[][](n+1, sumvmax+1);
    foreach(ref v ; dp[]) { v[] = INF;}
    dp[0][0] = 0;
    for(long i = 0; i < sumvmax; i++) {
        impl(n, i, ws, vs, dp);
    }
    long max;
    for (long i = 0; i <= sumvmax; i++) {
        if (dp[n][i] <= w) {
            max = i;
        }
    }
    return max;
}

void main() {
    immutable i1 = readln.split.to!(long[]);
    immutable n = i1[0], w = i1[1];
    auto ws = new long[n];
    auto vs = new long[n];

    for(auto i = 0; i < n; i++) {
        auto input = readln.split.to!(long[]);
        ws[i] = input[0];
        vs[i] = input[1];
    }

    writeln(solve(n, w, ws, vs));
}
