L = input() N = input() W = list(map(int, input().split())) sum = 0 i = 0 while sum <= L: sum += w[i] i += 1 print(i + 1)