let split_on_char sep s =
  let open String in
  let r = ref [] in
  let j = ref (length s) in
  for i = length s - 1 downto 0 do
    if get s i = sep then begin
      r := sub s (i + 1) (!j - i - 1) :: !r;
      j := i
    end
  done;
  sub s 0 !j :: !r

let read () =
  match List.map int_of_string (split_on_char ' ' (read_line ())) with
  | [x; y] -> (x, y)
  | _ -> exit 1

let () =
  let (n, w) = read () in
  let z = (100*n + 1) in
  let t = Array.make z (w + 1) in
  t.(0) <- 0;
  for i = 0 to n - 1 do
    let (vi, wi) = read () in
    for j = z - 1 downto vi do
      if t.(j) > t.(j-vi) + wi then t.(j) <- t.(j-vi) + wi
    done
  done;
  let rec print i =
    if i < 0 then exit 1
    else if t.(i) <= w then Printf.printf "%d\n" i
    else print (i - 1) in
  print (z - 1)