import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

/*

ナップサック問題（価値の上限が小さい）

xs[i][v]: i番目まで(index <= i)で、価値vを達成するのに必要な容量

xs[0][0] = 0
xs[0][v] = infinity
xs[i][v] = min(
		ws[i], // i個目を取る前提 v - vs[i] < 0 の場合
		xs[i - 1][v - vs[i]] + ws[i], // i個目を取る前提 v - vs[i] >= 0 
		xs[i - 1][v] // i個目を取らない前提
	)

求めるものは

xs[n - 1][v] <= npw であるような最大のv

*/

void main(){
	long n = read.to!long;
	long npw = read.to!long;
	
	long[] ws, vs;
	foreach(i; 0 .. n){
		ws ~= read.to!long;
		vs ~= read.to!long;
	}
	
	long infty = npw * 100;
	
	long vmax;
	foreach(v; vs) vmax += v;
	
	long[][] xs = [[0]];
	foreach(v; 1 .. vmax + 1) xs[0] ~= infty;
	
	foreach(i; 0 .. n){
		long[] q = [];
		foreach(v; 0 .. vmax + 1){
			q ~= min(
				xs[$ - 1][v],
				(v - vs[i] < 0)? ws[i]: xs[$ - 1][v - vs[i]] + ws[i]
			);
		}
		debug writeln("q:", q, " i:", i);
		xs ~= q;
	}
	
	long ans;
	foreach(v; 0 .. vmax + 1) if(xs[n][v] <= npw) ans = v;
	
	ans.writeln;
}
