static Scanner in = new Scanner(System.in);
public static void main(String[] args) {
int leng = in.nextInt();
HashMap<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < leng; i++) {
map.putIfAbsent(in.nextInt(), i + 1);
}
System.out.println(map.getOrDefault(in.nextInt(), -1));
}