n,w=map(int,input().split())
x=[0]*n
y=[0]*n
DP = [10**9+5]*(10**5+5)
DP[0] = 0
Sum = 0
for i in range(n):
x[i],y[i]=map(int,input().split())
Sum+=y[i]
for j in range(Sum,y[i]-1,-1):
DP[j] = min(DP[j],DP[j-y[i]]+x[i])
for i in range(Sum,-1,-1):
if DP[i]<=w:
print(i)
break
#Accepted code
bix3PW1hcChpbnQsaW5wdXQoKS5zcGxpdCgpKQp4PVswXSpuCnk9WzBdKm4KCkRQID0gWzEwKio5KzVdKigxMCoqNSs1KQpEUFswXSA9IDAKClN1bSA9IDAKZm9yIGkgaW4gcmFuZ2Uobik6CiAgICB4W2ldLHlbaV09bWFwKGludCxpbnB1dCgpLnNwbGl0KCkpCiAgICBTdW0rPXlbaV0KICAgIGZvciBqIGluIHJhbmdlKFN1bSx5W2ldLTEsLTEpOgogICAgICAgIERQW2pdID0gbWluKERQW2pdLERQW2oteVtpXV0reFtpXSkKCmZvciBpIGluIHJhbmdlKFN1bSwtMSwtMSk6CiAgICBpZiBEUFtpXTw9dzoKICAgICAgICBwcmludChpKQogICAgICAgIGJyZWFrCiNBY2NlcHRlZCBjb2Rl