import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = [0] * (n + 1)
    for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
    for i in cumsum:
        if i <= x:
            ans += 1
        else:
            break
    print(ans)
    
if __name__ == '__main__':
    main() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = [0] * (n + 1)
    for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
    for i in cumsum:
        if i <= x:
            ans += 1
        else:
            break
    print(ans)
     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 ans = 0 ans 0 cumsum = [0] * (n + 1) cumsum [0] * (n + 1) [0] 0 n + 1 n 1 for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
     i range(len(l)) range len(l) len l cumsum[i+1] = cumsum[i] + l[i] cumsum[i+1] cumsum i+1 i 1 cumsum[i] + l[i] cumsum[i] cumsum i l[i] l i for i in cumsum:
        if i <= x:
            ans += 1
        else:
            break
     i cumsum if i <= x:
            ans += 1
        else:
            break
     i <= x i x ans += 1 ans 1 break print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = [0] * (n + 1)
    for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
    for i in cumsum:
        if i <= x:
            ans += 1
        else:
            break
    print(ans)
     def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = [0] * (n + 1)
    for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
    for i in cumsum:
        if i <= x:
            ans += 1
        else:
            break
    print(ans)
     main
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    ans = 0
    cumsum = [0] * (n + 1)
    for i in range(len(l)):
        cumsum[i+1] = cumsum[i] + l[i]
    for i in cumsum:
        if i <= x:
            ans += 1
        else:
            break
    print(ans)
    
if __name__ == '__main__':
    main()