DEBUG=False def binary_search(A, T): L = 0 R = len(A) - 1 m=-1 while L < R: m = (L + R) // 2 if A[m] < T: L = m + 1 elif A[m]>=T: R=m if A[L]==T: return L else: return -1 input_string = input().strip() list_part, target_part = input_string.split(" ") L = [] for s in list_part[1:-1].split(','): L.append(int(s)) t = int(target_part.strip()) result = binary_search(L, t) print(result)