A team quiz game called "What? Where? When?" is very popular in Berland. The game is centered on two teams competing. They are the team of six Experts versus the team of the Audience. A person from the audience asks a question and the experts are allowed a minute on brainstorming and finding the right answer to the question. All it takes to answer a typical question is general knowledge and common logic. The question sent be the audience are in envelops lain out in a circle on a round table. Each envelop is marked by the name of the asker's town. Each question is positioned in a separate sector. In the centre of the table is a spinning arrow. Thus, the table rather resembles a roulette table with no ball but with a spinning arrow instead. The host sets off the spinning arrow to choose a question for the experts: when the arrow stops spinning, the question it is pointing at is chosen. If the arrow points at the question that has already been asked, the host chooses the next unanswered question in the clockwise direction. Your task is to determine which will be the number of the next asked question if the arrow points at sector number *k*.
The first line contains two positive integers *n* and *k* (1 ≤ *n* ≤ 1000 and 1 ≤ *k* ≤ *n*) — the numbers of sectors on the table and the number of the sector where the arrow is pointing. The second line contains *n* numbers: *a*<sub class="lower-index">*i*</sub> = 0 if the question from sector *i* has already been asked and *a*<sub class="lower-index">*i*</sub> = 1 if the question from sector *i* hasn't been asked yet (1 ≤ *i* ≤ *n*). The sectors are given in the clockwise order, the first sector follows after the *n*-th one.
5 5
0 1 0 1 0
2
2 1
1 1
1
3 2
1 0 0
1
3 3
0 1 0
2
1 1
1
1
6 3
0 0 1 1 0 1
3
3 1
0 1 0
2
3 3
1 0 1
3
4 4
1 0 1 0
1
5 3
0 1 0 1 1
4
6 4
1 0 0 0 0 1
6
7 5
1 0 0 0 0 0 1
7
101 81
1 0 1 1 1 1 0 0 1 1 1 1 1 0 0 1 0 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 1 0 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 0
82
200 31
1 0 0 1 1 1 0 0 0 0 0 1 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 1 0 1 1 0 0 1 1 1 1 1 0 1 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 0 0 0 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0
33
17 13
0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 1 1
13
102 9
0 0 0 0 1 1 0 1 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1
10
f = open('input.txt','r')
srt = f.readline().replace("\n"," ").split(" ")[:-1]
n = int(srt[0])
k = int(srt[1])
a = f.readline().replace("\n"," ").split(" ")[:-1]
for i in range(len(a)):
    a[i] = int(a[i])
f.close()
f = False
for i in range(n-1):
    if a[i] == 1:
        s= i+1
        f = True
        break
for i in range(k,n):
    if a[i] == 1:
        s= i+1
        break
print(s)
