#include <bits/stdc++.h>
using namespace std;

int FirstIndexOccurence(int arr[], int size, int idx, int x){
	if(idx == size){
		return -1;
	}
	if(arr[idx] == x){
		return idx;
	} else {
			int FirstIndex_is_SmallArr = FirstIndexOccurence(arr, size, idx + 1, x);
			return FirstIndex_is_SmallArr;
	}
}

int main(){
	int n;
	cin>>n;
	int arr[n];
	int length = sizeof(arr)/sizeof(arr[0]);
	for(int i = 0; i < length; i++){
		cin>>arr[i];
	}
	int data;
	cin>>data;
	int FirstIndex = FirstIndexOccurence(arr, length, 0, data);
	cout<<FirstIndex<<endl;
}
