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

WV=[]

for i in range(N):

    WV.append(list(map(int,input().split())))

dp=[[0 for i in range(10**5+1)] for j in range(N+1)]

dp[0][1:]=[10**18 for i in range(10**5)]

for i in range(N+1):

    for j in range(10**5+1):

        if i>0:

            if j-WV[i-1][1]>=0:

                dp[i][j]=min(dp[i-1][j],dp[i-1][j-WV[i-1][1]]+WV[i-1][0])

            else: 

                dp[i][j]=dp[i-1][j]

for i in reversed(list(range(10**5+1))):

    if dp[N][i]<=W:

        print(i)

        break
import numpy as np

MaxW=int(1e5)

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

WV=[]

for i in range(N):

    WV.append(list(map(int,input().split())))

dp=[1e30 for i in range(MaxW+1)]

dp[0]=0

dp=np.array(dp)

for i in range(N):

    dp[WV[i][1]:]=np.minimum(dp[WV[i][1]:],dp[:MaxW-WV[i][1]+1]+WV[i][0])

for i in reversed(list(range(MaxW+1))):

    if dp[i]<=W:

        print(i)

        break

        
N, W = list(map(int, input().split()))
WV = []
for i in range(N):
    WV.append(list(map(int, input().split())))
dp = [[0 for i in range(10**5 + 1)] for j in range(N + 1)]
dp[0][1:] = [10**18 for i in range(10**5)]
for i in range(N + 1):
    for j in range(10**5 + 1):
        if i > 0:
            if j - WV[i - 1][1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - WV[i - 1][1]] + WV[i - 1][0])
            else:
                dp[i][j] = dp[i - 1][j]
for i in reversed(list(range(10**5 + 1))):
    if dp[N][i] <= W:
        print(i)
        break

import numpy as np

MaxW = int(1e5)
N, W = list(map(int, input().split()))
WV = []
for i in range(N):
    WV.append(list(map(int, input().split())))
dp = [1e30 for i in range(MaxW + 1)]
dp[0] = 0
dp = np.array(dp)
for i in range(N):
    dp[WV[i][1] :] = np.minimum(dp[WV[i][1] :], dp[: MaxW - WV[i][1] + 1] + WV[i][0])
for i in reversed(list(range(MaxW + 1))):
    if dp[i] <= W:
        print(i)
        break

+import numpy as np + +MaxW = int(1e5) -dp = [[0 for i in range(10**5 + 1)] for j in range(N + 1)] -dp[0][1:] = [10**18 for i in range(10**5)] -for i in range(N + 1): -    for j in range(10**5 + 1): -        if i > 0: -            if j - WV[i - 1][1] >= 0: -                dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - WV[i - 1][1]] + WV[i - 1][0]) -            else: -                dp[i][j] = dp[i - 1][j] -for i in reversed(list(range(10**5 + 1))): -    if dp[N][i] <= W: +dp = [1e30 for i in range(MaxW + 1)] +dp[0] = 0 +dp = np.array(dp) +for i in range(N): +    dp[WV[i][1] :] = np.minimum(dp[WV[i][1] :], dp[: MaxW - WV[i][1] + 1] + WV[i][0]) +for i in reversed(list(range(MaxW + 1))): +    if dp[i] <= W: