import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons;

immutable int inf = 10^^9 + 7;
int N, W;
int[] v, w;

void main() {
    scan(N, W);

    int vi, wi;
    auto v = new int[](N);
    auto w = new int[](N);

    foreach (i ; 0 .. N) {
        scan(vi, wi);
        v[i] = vi;
        w[i] = wi;
    }

    auto dp = new int[](N * 100 + 1);
    dp[] = inf;
    dp[0] = 0;

    foreach (i ; 0 .. N) {
        foreach_reverse (j ; v[i] .. N * 100 + 1) {
            dp[j] = min(dp[j], dp[j - v[i]] + w[i]);
        }
    }

    foreach_reverse (j ; 0 .. N * 100 + 1) {
        if (dp[j] <= W) {
            writeln(j);
            return;
        }
    }
}


void scan(T...)(ref T args) {
    auto line = readln.split;
    foreach (ref arg ; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}