#include <stdio.h>
const int N=1e4+10;
const int INF=1e9+10;
int min(int a,int b){return a>b?b:a;}
int main(){
    int n,w,dp[N],x,y;
    scanf("%d%d",&n,&w);
    for(int i=1;i<N;i++)dp[i]=INF;
    dp[0]=0;
    while(n--){
        scanf("%d%d",&x,&y);
        for(int j=N-1;j>=x;j--)dp[j]=min(dp[j],dp[j-x]+y);
    }
    for(int i=N-1;i>=0;i--)if(dp[i]<=w){
        printf("%d\n",i);
        return 0;
    }
}
