def main():
    N, X = map(int, input().split())
    l = list(map(int, input().split()))
    p = 0
    record = [0]
    for i in range(N):
        p += l[i]
        if p > X:
            break
        record.append(p)
    print(len(record))
main()   def main():
    N, X = map(int, input().split())
    l = list(map(int, input().split()))
    p = 0
    record = [0]
    for i in range(N):
        p += l[i]
        if p > X:
            break
        record.append(p)
    print(len(record)) main N, X = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split X l = list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split p = 0 p 0 record = [0] record [0] 0 for i in range(N):
        p += l[i]
        if p > X:
            break
        record.append(p)
     i range(N) range N p += l[i] p l[i] l i if p > X:
            break
         p > X p X break record.append(p) record.append record append p print(len(record)) print len(record) len record main() main def main():
    N, X = map(int, input().split())
    l = list(map(int, input().split()))
    p = 0
    record = [0]
    for i in range(N):
        p += l[i]
        if p > X:
            break
        record.append(p)
    print(len(record)) def main():
    N, X = map(int, input().split())
    l = list(map(int, input().split()))
    p = 0
    record = [0]
    for i in range(N):
        p += l[i]
        if p > X:
            break
        record.append(p)
    print(len(record)) main
def main():
    N, X = map(int, input().split())
    l = list(map(int, input().split()))
    p = 0
    record = [0]
    for i in range(N):
        p += l[i]
        if p > X:
            break
        record.append(p)
    print(len(record))
main()  