import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.datetime;
import std.numeric;
import std.math;
import std.string;

string my_readln() { return chomp(readln()); }

void main()
{//try{
	auto tokens = split(my_readln());
	auto N = to!ulong(tokens[0]);
	auto W = to!ulong(tokens[1]);

	long[] w, v;
	foreach (i; 0..N)
	{
		auto tokens2 = split(my_readln());
		{
			w ~= to!long(tokens2[0]);
			v ~= to!long(tokens2[1]);
		}
	}

	ulong[int][] dp;
	dp.length = 110;
	dp[0][0] = 0;

	foreach (i; 0..N)
	{
		foreach (j; 0..100001)
		{
			auto tmp1 = dp[i].get(cast(int)(j - v[i]), long.max);
			auto tmp2 = dp[i].get(cast(int)j, long.max);
			ulong x   = min(tmp1 + w[i], tmp2);
			if (x <= W) dp[i+1][j] = x;
		}
	}

	auto keys = dp[N].keys.sort!"a > b"();
	writeln(keys[0]);
	stdout.flush();
	/*}catch (Throwable e)
	{
	writeln(e.toString());
	}
	readln();*/
}