using System;
using System.Collections.Generic;
using System.Linq;
namespace Paiza
{
    class Program
    {
        /// <summary>
        /// 空白区切の数値を取得する
        /// </summary>
        /// <returns>The read split int.</returns>
        static int[] ReadSplitInt()
        {
            return Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        }

        /// <summary>
        /// 空白区切の数値を取得
        /// </summary>
        /// <returns>The read split long.</returns>
        static long[] ReadSplitLong()
        {
            return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        }


        static int[][] ReadSplitIntLines(int n)
        {
            return Enumerable.Range(0, n).Select(x => ReadSplitInt()).ToArray();
        }
        static long[][] ReadSplitLongLines(int n)
        {
            return Enumerable.Range(0, n).Select(x => ReadSplitLong()).ToArray();
        }

        public static void Main(string[] args)
        {
 var NW = ReadSplitInt();
            var N = NW[0];
            var W = NW[1];
            var MAX_V = 100001;
            var wv = ReadSplitLongLines(N);
            var dp = new long[N + 1, MAX_V + 1];
            for (int i = 0; i <= MAX_V; i++)
            {
                for (int j = 0; j <= N; j++)
                {
                    dp[j, i] = int.MaxValue;
                }
            }
            dp[0, 0] = 0;
            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < MAX_V; j++)
                {
                    if (j - wv[i][1] >= 0)
                    {
                        dp[i + 1, j] = Math.Min(dp[i + 1, j], dp[i, j - wv[i][1]] + wv[i][0]);
                    }

                    dp[i + 1, j] = Math.Min(dp[i + 1, j], dp[i, j]);

                }
            }
            long min = 0;
            for (int i = 0; i < MAX_V; i++)
            {
                if (dp[N, i] <= W) 
                {
                    min = i;
                }
            }
            Console.WriteLine(min);


        }

        private static void kaeru()
        {

            var N = int.Parse(Console.ReadLine());
            var h = ReadSplitInt();
            var H = h.Count();
            var dp = new int[N + 2];
            for (int i = 0; i < N; i++)
            {
                dp[i] = int.MaxValue;
            }
            dp[0] = 0;
            for (int i = 0; i < N ; i++)
            {
                for (int j = 1; j <= 2; j++)
                {
                    if (i + j < N)
                    {
                        dp[i + j] = Math.Min(dp[i + j], dp[i] + Math.Abs(h[i + j] - h[i]));
                    }
                }
            }

            Console.WriteLine(dp[N - 1]);
        }

        private static void knapsack1()
        {
            var NW = ReadSplitInt();
            var N = NW[0];
            var W = NW[1];
            var wv = ReadSplitIntLines(NW[0]);
            var w = wv.Select(x => x[0]).ToArray();
            var v = wv.Select(x => x[1]).ToArray();

            var dp =  new long[N + 1, W + 1];

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j <= W; j++)
                {
                    if (j - w[i] >= 0)
                    {
                        dp[i + 1, j] = Math.Max(dp[i + 1, j], dp[i, j - w[i]] + v[i]);
                    }

                    dp[i + 1, j] = Math.Max(dp[i + 1, j], dp[i, j]);

                }
            }

            Console.WriteLine(dp[N, W]);
        }

        private static void frog11()
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split(' ').Select(y => int.Parse(y)).ToArray();
            var dp = new int[n + 1];
            for (int i = 0; i < n+1; i++)
            {
                dp[i] = int.MaxValue;
            }
            dp[0] = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 1; j <= 2; j++)
                {
                    if ( i + j <  n)
                    {
                        dp[i + j] = Math.Min(dp[i + j], dp[i] + Math.Abs(a[i] - a[i + j]));
                    }
                }
            }
            Console.WriteLine(dp[n]);
        }

        /// <summary>
        /// ナップサック問題
        /// </summary>
        private static void knapsack()
        {
            var nw = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var n = nw[0];
            var w = nw[1];

            var wv = Enumerable.Range(0, n).Select(x => Console.ReadLine().Split(' ').Select(y => long.Parse(y)).ToArray()).ToArray();

            //　n=0は無駄に終わるため。
            // w:０からwまでの値が欲しいため
            var dp = new long[n+1 , w + 1];


            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j <= w; j++)
                {
                    if (j - wv[i][0] >= 0)
                    {
                        dp[i + 1, j] = Math.Max(dp[i + 1, j], dp[i, j - wv[i][0]] + wv[i][1]);
                    }

                    dp[i + 1, j] = Math.Max(dp[i + 1, j], dp[i, j]);
                }
            }

            Console.WriteLine(dp[n,w]);
        }

        private static void vacation()
        {

            var n = int.Parse(Console.ReadLine());
            var abc = Enumerable.Range(0, n).Select(x => Console.ReadLine().Split(' ').Select(y => int.Parse(y)).ToArray()).ToArray();

            var dp = new int[n + 1, 3];

            int max = -1;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    for (int k = 0; k < 3; k++)
                    {
                        if (j == k)
                        {
                            continue;
                        }
                            dp[i + 1, k] = Math.Max(dp[i + 1, k], dp[i , j] + abc[i][k]);
                    }
                }
            }
            max = 0;
            for (int i = 0; i < 3; i++)
            {
                max = Math.Max(max, dp[n , i]);
            }

            Console.WriteLine(max);
        }
}
}

Measured memory_bytes: 92128