let () = Scanf.scanf "%d %d\n" @@ fun n x ->
  let ls = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun l -> l in
  Printf.printf "%d\n" @@ snd @@ Array.fold_left (fun (acc, n) l ->
    acc + l, n + if acc <= x then 1 else 0) (0, 0) ls