Item = Struct.new(:weight, :value)
n_items, limit_weight = (gets || "").split.map(&:to_i)
items = n_items.times.map { Item[*(gets || "").split.map(&:to_i)] }
sup_value = items.sum(&:value)

=begin
価値を1つずつ増やしていき、重さの最小値がlimit_weightを越えたところで終了
dp[価値][番号] = 重さ
=end

dp = [[0] * 101]
max_value = 0
(1..sup_value).each do |value|
  dp[value] = [Float::INFINITY]
  items.each_with_index do |item, index|
    dp[value][index+1] = [
      dp[value][index],
      value >= item.value ? dp[value - item.value][index] + item.weight : Float::INFINITY
      ].min
  end
  if dp[value][n_items] <= limit_weight
    max_value = value
  end
end

puts max_value