L = int(input()) N = int(input()) w = list(map(int, input().split())) n = 0 s = int(0) while s < L: s += w n += 1 print(n)