def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end
def ang(n) Array.new(n){gsmi} end
def debug(k,v) puts "#{k}: #{v}" end
def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+) end

def arrays(n,num) #要素数、配列数
  ret = Array.new(num){Array.new(n)}
  n.times do |i|
    ins = gsmi
    num.times{|j| ret[j][i] = ins[j] }
  end
  ret
end
inf = Float::INFINITY
$stdin = File.open('input.txt') if File.exist?('input.txt')
n,w_max = gsmi #100, 10**9
ws,vs = arrays(n,2) #w, 10**5
ws.unshift 0
vs.unshift 0

v_max = 100001
dp = Array.new(n+1){Array.new(v_max){inf}}
dp[0][0] = 0
(1..n).each do |i|
  v_max.times do |j|
    if(j-vs[i]>=0)
      #puts vs[i] if i==1 && j==1
      dp[i][j] = min(dp[i-1][j], dp[i-1][j-vs[i]]+ws[i])
    else
      dp[i][j] = dp[i-1][j]
    end
  end
end

(0...v_max).reverse_each do |j|
  if dp[-1][j]<=w_max
    puts j
    exit
  end
end
