import sys

input = sys.stdin.readline

import numpy as np

 

N,W = list(map(int, input().split()))

 

dp = [10 ** 10] * N * (10 ** 4)

dp[0] = 0

dp = np.array(dp)

 

 

for i in range(N):

    w,v = list(map(int, input().split()))

    dp[v:] = np.minimum(dp[v:] , dp[:-v] + w)

  

for i,count in enumerate(dp):

    if dp[i] <= W:

        ans = i

print(ans)
import sys

input = sys.stdin.readline

import numpy as np

 

N,W = list(map(int, input().split()))

 

dp = [10 ** 10] * (N * (10 ** 3) + 1)

dp[0] = 0

dp = np.array(dp)

 

 

for i in range(N):

    w,v = list(map(int, input().split()))

    dp[v:] = np.minimum(dp[v:] , dp[:-v] + w)

  

for i,count in enumerate(dp):

    if dp[i] <= W:

        ans = i

print(ans)
import sys

input = sys.stdin.readline
import numpy as np

N, W = list(map(int, input().split()))
dp = [10**10] * N * (10**4)
dp[0] = 0
dp = np.array(dp)
for i in range(N):
    w, v = list(map(int, input().split()))
    dp[v:] = np.minimum(dp[v:], dp[:-v] + w)
for i, count in enumerate(dp):
    if dp[i] <= W:
        ans = i
print(ans)

import sys

input = sys.stdin.readline
import numpy as np

N, W = list(map(int, input().split()))
dp = [10**10] * (N * (10**3) + 1)
dp[0] = 0
dp = np.array(dp)
for i in range(N):
    w, v = list(map(int, input().split()))
    dp[v:] = np.minimum(dp[v:], dp[:-v] + w)
for i, count in enumerate(dp):
    if dp[i] <= W:
        ans = i
print(ans)

-dp = [10**10] * N * (10**4) +dp = [10**10] * (N * (10**3) + 1)