# def f():
# b=0
# global n
# global m
# global a
# if a>=max(m):
# return n+1
#
# for i in range(n):
# if a<m[i]:
# return i+1
#
# n=int(input())
# m=list(map(int,input().split()))
# a=int(input())
# print(f())
def f():
global n
global m
global a
for i in range(n):
if a==m[i]:
return i+1
return -1
n=int(input())
m=list(map(int,input().split()))
a=int(input())
#print(m, n, a)
print(f())