num_list = list(map(int,input().split()))
for i in range(0,5):
    if(num_list[i]==1):
        print(i+1)
    else:
        continue