#include <bits/stdc++.h>
#define int long long int

using namespace std ;

const int N = 120 , M = 1e5 + 100;
int n , W , v[N] , w[N] , dp[N][M] ;

int32_t main(){
	cin >> n >> W ;
	for(int i = 0 ; i < n ; i++){
		cin >> w[i] >> v[i] ;
	}
	for(int i = 0 ; i < n ; i++)
	fill(dp[i] , dp[i] + M, 1e17) ;
	dp[0][v[0]] = w[0] ;
	for(int i = 1 ; i < n ; i++){
		for(int j = 0 ; j < v[i] ; j++)
			dp[i][j] = dp[i - 1][j] ;
		dp[i][v[i]] = min(w[i] , dp[i - 1][v[i]]) ;
		for(int j = v[i] ; j < M; j++){
			dp[i][j] = min(dp[i - 1][j] , dp[i][j]) ;
			if(w[i] + dp[i - 1][j - v[i]] <= W)
				dp[i][j] = min(dp[i - 1][j] , w[i] + dp[i - 1][j - v[i]]) ;
		}
	}
	int ans ;
	for(int i = 0 ; i < M ; i++)
		if(dp[n - 1][i] - 1e17)
			ans = i ;
	cout << ans ;
	return 0 ; 
}
/*
#include <radman/roderc++.h>
                     ....._____
                 .~~~~~////////\\                                                                                           ...
              .:::::////////////\\                                          ....::////////..                              (/\\\\...
           .::::://////   \\\\///\\              .:::://                ..:::::///////////////.                           \\\\\$$$$$$
         \\\\\//////      \\\\///\\           //\\\//////             \\\\\////////////////////.                           ""\\$$$$$$$
         \\\\\////         \\\\////         |||||////////.            \\\\\/////     ~~~~~//////          ...                  "\$$$$
         \\\\\//\         ////|||/          \\\\\/////////            \\\\\//\       ~~~~~//////        (/\\\\...                   .
         \\\\\//\        ////|||/          |||||////*\\///.           \\\\\//\       ~~~~~//////        \\\\\$$$$$$                 .@@@@@.
         \\\\\//\       ////|||/           \\\\\///|\\\////           \\\\\//\       ~~~~~//////         ""\\$$$$$$$               @@@@////\
         \\\\\//\ ____---/|||/            |||||///|\\\\\///.          \\\\\//\       ~~~~~//////             "\$$$$                @@@@\///\
         \\\\\//\--|||||||_-'             \\\\\///|\\\\\////          \\\\\//\       ~~~~~//////                                  ,@@@@|///|
         \\\\\//\|||||_"-\\\\\           |||||///|  ~~~~~///.         \\\\\//\      ~~~~~//////     .@@@@.                    /@@@@@|/////
         \\\\\//\///"""\\\\\\\\          \\\\\///|~~~~[[[////.        \\\\\//\     ~~~~~//////      @@@@@@@@                ..@@@@@.//////
         \\\\\//\    \"""\\\\\\\        |||||///|~~[[[[["\////.       \\\\\//\    ~~~~~//////      '@@@@/////\       .:;@@@@@@@..///////"
         \\\\\//\      \"""\\\\\\       \\\\\///|[[[[*\\\\\////.      \\\\\//\   ~~~~~//////        *@@@\//////\@@@@@@@@..//////////"
         \\\\\//\       \:::\\\\/      |||||///|[[[*   \\\\\\///      \\\\\//\~~~~~///////'            *@@\/////////////////////"
         \\\\\//\        \___\\/       \\\\\///|*       \\\\\/"       \\\\\//\~~////////'                 **"///////////"""
         \\\\\//\                     |||||///|                       \\\\\//\///////"
         \\\\\//\                     \\\\\///|                       \\\\\//\////"
         \\\\\///                    |||||////|                       \\\\\////"
         \\\\\/"                     \\\\\///*                        \\\\\/"
                                     """""*
*/


Measured memory_bytes: 80128