l = [int(i) for i in input().split()]
index = 0
while l[index] != 1:
    index += 1
print(index+1)