{-# OPTIONS_GHC -Wall #-}

import Control.Monad
import Data.Array

readInt :: String -> Int
readInt = read

inf :: Int
inf = 1010000000000000000

calcDp :: Int -> Array Int Int -> Array Int Int -> Array (Int,Int) Int
calcDp n vs ws = dp
    where
        -- i種類目までで価値jを実現する最小重量
        dp = listArray ((0,0),(n,10000)) [f i j | i<-[0..n], j<-[0..10000]]
        f _ 0 = 0
        f 0 _ = inf
        f i j
            | j >= v    = min (w+dp!(i-1,j-v)) (dp!(i-1,j))
            | otherwise = dp!(i-1,j)
            where
                v = vs!(i-1)
                w = ws!(i-1)

main :: IO ()
main = do
    [n,wmax] <- fmap (map readInt . words) getLine
    vws      <- replicateM n $ do
        [v,w] <- fmap (map readInt . words) getLine
        return (v,w)
    let vs = listArray (0,n-1) $ map fst vws
    let ws = listArray (0,n-1) $ map snd vws

    let dp  = calcDp n vs ws
    let ans = maximum $ filter (\j -> dp!(n,j) <= wmax) [0..10000]

    --print dp
    print ans

