#include <bits/stdc++.h>
using namespace std;
int main(){
    int i,xm=-1;
    cin>>i;
    int o,q[i];
    for(int oo=0;oo<i;oo++)cin>>q[oo];
    cin>>o;
    for(int i2=0;i2<i;i2++){
        if(q[i2]==o){
            cout<<i2+1;
            break;
        }
        if(i2==i-1){
            cout<<-1;
            break;
        }
    }
    return 0;
}
/**************************************************************
	Problem: 1236
	User: lijinkai
	Language: C++
	Result: Accepted
	Time:290 ms
	Memory:3904 kb
****************************************************************/