import scala.io.StdIn._

object Main extends App {


  val Array(n,w) = readLine().split(" ").map(_.toInt)
  val wv = Array.fill(n)(readLine().split(" ").map(_.toInt))

  val MaxV = 1e5.toInt + 10
  val MaxW = 1e9.toInt + 10
  val dp = Array.fill(n+1)(Array.fill(MaxV)(1e17.toLong))
  dp(0)(0) = 0
  def solve() = {
    for {
      i    <- 0 until n
      sumV <- 0 until MaxV
    } {
      if(sumV - wv(i)(1) >= 0) {
        dp(i+1)(sumV) = Math.min(dp(i)(sumV), dp(i)(sumV - wv(i)(1)) + wv(i)(0))
      } else dp(i+1)(sumV) = dp(i)(sumV)
    }

    var ans = 0L
    for(i <- 0 until MaxV) {
      if(dp(n)(i) <= w) ans = i
    }
    ans
  }





  println(solve())

}

