// editor3
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
    int data;
    struct node *next;
}node;
node *head =NULL,*tail;
void create(int num){
    node *newnode = (node*)malloc(1*sizeof(node));
    newnode->data=num;
    newnode->next=NULL;
    if(head == NULL){
        head=newnode;
        tail=newnode;
    }
    else{
        tail->next=newnode;
        tail=newnode;
        
    }
}
void findpos(int val){
    node *temp=head;
    int pos = -1;
    while(temp!= NULL){
        if(temp->data = val){
            return pos;
        }
        temp=temp->next;
        pos++
        }
        return -1;
    
}
void display(){
    node *itr;
    for(itr=head;itr!=NULL;itr=itr->next){
        printf("%d ",itr->data);
    }
    }
    int main(){
        int n,num;
        scanf("%d",&n);
        if(n<0){
            printf("Invalid Input");
        return 0;
            
        }
        for(int i=1;i<=n;i++){
            scanf("%d",&num);
            create(num);
        }
        int val;
        scanf("%d",&val);
        int pos=findpos(val);
        if(pos == -1){
            printf("-1");
        }
        else
        printf("%d",pos);
        return 0;
    }
        }
    }