let () =
    let split s =
        let rec loop i cur flag acc =
            if i = String.length s then (
                if flag then cur :: acc else acc
            ) else (
                match flag, s.[i] with
                | true,  ' ' -> loop (i + 1) 0 false (cur :: acc)
                | false, ' ' -> loop (i + 1) 0 false acc
                | true,  v   -> loop (i + 1) (cur * 10 + int_of_char v - 48) true acc
                | false, v   -> loop (i + 1) (cur * 10 + int_of_char v - 48) true acc
            )
        in
        List.rev (loop 0 0 false [])
    in
    let main () =
        let n, x = Scanf.sscanf (read_line ()) "%d %d" (fun n x -> n, x) in
        let l = Array.of_list (split (read_line ())) in
        let a = Array.make (n + 1) 0 in
        for i = 1 to n do
            a.(i) <- a.(i - 1) + l.(i - 1)
        done;
        let rec loop i =
            if i <= n && a.(i) <= x then loop (i + 1) else i
        in
        Printf.printf "%d\n" (loop 0)
    in
    main()