#include<iostream>
using namespace std;
int rec(int n, int x[], int v)
{
if(n == 0)
return -1;
else if(x[n] != v)
rec(n-1, x, v);
else
return n;
}
int main()
{
int n, x[10], numar;
cin >> n;
for(int i=1; i<=n; i++) cin >> x[i];
cin >> numar;
cout << rec(n, x, numar);
return 0;
}