# abc130_b.py
# https://atcoder.jp/contests/abc130/tasks/abc130_b

# B - Bounding /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 数直線上を N+1回跳ねるボールがあり、1 回目は 座標 D1=0, i 回目は 座標 Di=Di−1+Li−1(2≤i≤N+1)で跳ねます。
# 数直線の座標が X以下の領域でボールが跳ねる回数は何回でしょうか。

# 制約
#     1≤N≤100
#     1≤Li≤100
#     1≤X≤10000
#     入力は全て整数である

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N X
# L1 L2 ... LN−1 LN

# 出力
# 数直線の座標が X以下の領域でボールが跳ねる回数を出力せよ。

# 入力例 1
# 3 6
# 3 4 5

# 出力例 1
# 2

# ボールは順に座標 0,3,7,12で跳ねるので、座標 6 以下の領域で跳ねる回数は 2回です。

# 入力例 2
# 4 9
# 3 3 3 3

# 出力例 2
# 4

# ボールは順に座標 0,3,6,9,12で跳ねるので、座標 9 以下の領域で跳ねる回数は 4 回です。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    N, X = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    su = 0
    cnt = 1
    for i in range(N):
        su += values[i]
        if su <= X: 
            cnt += 1
        else:
            break

    return [cnt]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 6', '3 4 5']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['4 9', '3 3 3 3']
        lines_export = [4]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main() global FLAG_LOG FLAG_LOG = False FLAG_LOG False def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value)) log if FLAG_LOG:
        print(str(value)) FLAG_LOG print(str(value)) print str(value) str value value value def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    N, X = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    su = 0
    cnt = 1
    for i in range(N):
        su += values[i]
        if su <= X: 
            cnt += 1
        else:
            break

    return [cnt]


# 引数を取得 calculation N, X = list(map(int, lines[0].split())) N list(map(int, lines[0].split())) list map(int, lines[0].split()) map int lines[0].split() [0].split [0] lines 0 split X values = list(map(int, lines[1].split())) values list(map(int, lines[1].split())) list map(int, lines[1].split()) map int lines[1].split() [1].split [1] lines 1 split su = 0 su 0 cnt = 1 cnt 1 for i in range(N):
        su += values[i]
        if su <= X: 
            cnt += 1
        else:
            break

     i range(N) range N su += values[i] su values[i] values i if su <= X: 
            cnt += 1
        else:
            break

     su <= X su X cnt += 1 cnt 1 break return [cnt] [cnt] cnt lines lines def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ get_input_lines lines = list() lines list() list for _ in range(lines_count):
        lines.append(input())
     _ range(lines_count) range lines_count lines.append(input()) lines.append lines append input() input return lines lines lines_count lines_count def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 6', '3 4 5']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['4 9', '3 3 3 3']
        lines_export = [4]
    return lines_input, lines_export


# 動作モード判別 get_testdata if pattern == 1:
        lines_input = ['3 6', '3 4 5']
        lines_export = [2]
     pattern == 1 pattern 1 lines_input = ['3 6', '3 4 5'] lines_input ['3 6', '3 4 5'] '3 6' '3 4 5' lines_export = [2] lines_export [2] 2 if pattern == 2:
        lines_input = ['4 9', '3 3 3 3']
        lines_export = [4]
     pattern == 2 pattern 2 lines_input = ['4 9', '3 3 3 3'] lines_input ['4 9', '3 3 3 3'] '4 9' '3 3 3 3' lines_export = [4] lines_export [4] 4 return lines_input, lines_export return lines_input, lines_export lines_input lines_export pattern pattern def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理 get_mode import sys sys args = sys.argv args sys.argv sys argv global FLAG_LOG if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
     len(args) == 1 len(args) len args 1 mode = 0 mode 0 FLAG_LOG = False FLAG_LOG False mode = int(args[1]) mode int(args[1]) int args[1] args 1 FLAG_LOG = True FLAG_LOG True return mode mode def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理 main import time time started = time.time() started time.time() time.time time time mode = get_mode() mode get_mode() get_mode if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

     mode == 0 mode 0 lines_input = get_input_lines(2) lines_input get_input_lines(2) get_input_lines 2 lines_input, lines_export = get_testdata(mode) lines_input get_testdata(mode) get_testdata mode lines_export lines_result = calculation(lines_input) lines_result calculation(lines_input) calculation lines_input for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理 line_result lines_result print(line_result) print line_result if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ get_input_lines def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理 def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理 main global FLAG_LOG FLAG_LOG = False False FLAG_LOG def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value)) def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value)) log def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 6', '3 4 5']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['4 9', '3 3 3 3']
        lines_export = [4]
    return lines_input, lines_export


# 動作モード判別 def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 6', '3 4 5']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['4 9', '3 3 3 3']
        lines_export = [4]
    return lines_input, lines_export


# 動作モード判別 get_testdata def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    N, X = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    su = 0
    cnt = 1
    for i in range(N):
        su += values[i]
        if su <= X: 
            cnt += 1
        else:
            break

    return [cnt]


# 引数を取得 def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    N, X = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    su = 0
    cnt = 1
    for i in range(N):
        su += values[i]
        if su <= X: 
            cnt += 1
        else:
            break

    return [cnt]


# 引数を取得 calculation def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理 def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理 get_mode
# abc130_b.py
# https://atcoder.jp/contests/abc130/tasks/abc130_b

# B - Bounding /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 数直線上を N+1回跳ねるボールがあり、1 回目は 座標 D1=0, i 回目は 座標 Di=Di−1+Li−1(2≤i≤N+1)で跳ねます。
# 数直線の座標が X以下の領域でボールが跳ねる回数は何回でしょうか。

# 制約
#     1≤N≤100
#     1≤Li≤100
#     1≤X≤10000
#     入力は全て整数である

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N X
# L1 L2 ... LN−1 LN

# 出力
# 数直線の座標が X以下の領域でボールが跳ねる回数を出力せよ。

# 入力例 1
# 3 6
# 3 4 5

# 出力例 1
# 2

# ボールは順に座標 0,3,7,12で跳ねるので、座標 6 以下の領域で跳ねる回数は 2回です。

# 入力例 2
# 4 9
# 3 3 3 3

# 出力例 2
# 4

# ボールは順に座標 0,3,6,9,12で跳ねるので、座標 9 以下の領域で跳ねる回数は 4 回です。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    N, X = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    su = 0
    cnt = 1
    for i in range(N):
        su += values[i]
        if su <= X: 
            cnt += 1
        else:
            break

    return [cnt]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 6', '3 4 5']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['4 9', '3 3 3 3']
        lines_export = [4]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()
