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

wv = [tuple(map(int, input().split())) for _ in range(n)]



INF = 10**9 + 100

MAX_V = 10**5 + 100

dp = [INF] * (MAX_V + 1)

dp[0] = 0

for wi, vi in wv:

    for sum_v in reversed(list(range(vi, MAX_V+1))):

        dp[sum_v] = min(dp[sum_v - vi] + wi, dp[sum_v])

#print(dp)

ans = 0

for i in range(MAX_V, -1, -1):

    if dp[i] <= w:

        print(i)

        exit()

#print(ans)

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

wv = [tuple(map(int, input().split())) for _ in range(n)]



INF = 10**9 + 100

MAX_V = 10**5 + 100

dp = [INF] * (MAX_V + 1)

dp[0] = 0

for wi, vi in wv:

    for sum_v in reversed(list(range(vi, MAX_V+1))):

        dp[sum_v] = min(dp[sum_v - vi] + wi, dp[sum_v])

#print(dp)

ans = 0

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

    if dp[i] <= w:

        print(i)

        exit()

#print(ans)

n, w = list(map(int, input().split()))
wv = [tuple(map(int, input().split())) for _ in range(n)]
INF = 10**9 + 100
MAX_V = 10**5 + 100
dp = [INF] * (MAX_V + 1)
dp[0] = 0
for wi, vi in wv:
    for sum_v in reversed(list(range(vi, MAX_V + 1))):
        dp[sum_v] = min(dp[sum_v - vi] + wi, dp[sum_v])
# print(dp)
ans = 0
for i in range(MAX_V, -1, -1):
    if dp[i] <= w:
        print(i)
        exit()
# print(ans)

n, w = list(map(int, input().split()))
wv = [tuple(map(int, input().split())) for _ in range(n)]
INF = 10**9 + 100
MAX_V = 10**5 + 100
dp = [INF] * (MAX_V + 1)
dp[0] = 0
for wi, vi in wv:
    for sum_v in reversed(list(range(vi, MAX_V + 1))):
        dp[sum_v] = min(dp[sum_v - vi] + wi, dp[sum_v])
# print(dp)
ans = 0
for i in reversed(list(range(MAX_V + 1))):
    if dp[i] <= w:
        print(i)
        exit()
# print(ans)

-for i in range(MAX_V, -1, -1): +for i in reversed(list(range(MAX_V + 1))):