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