#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node*next;
}Node;
Node*createNode(int data){
    Node*newNode=(Node*)malloc(sizeof(Node));
    newNode->data=data;
    newNode->next=NULL;
    return newNode;
}
int searchValue(Node*head,int x){
    Node*current=head;
    int position=1;
    while(current=!NULL){
        if(current->data==x){
            return position;
        }
        current=current->next;
        position++; 
    }
    return -1;
}int main(){
    int n;
    scanf("%d",&n);
    Node*head=NULL;
    Node*current=NULL;
    int data;
    for(int i=0;i<n;i++){
        scanf("%d",&data);
        if(head==NULL){
            head=createNode(data);
            current=head;
        }
        else{
            current->next=createNode(data);
            current=current->next;
           
        }
        }
        int x;
        scanf("%d",&x);
        printf("%d\n",searchValue(head,x));
        return 0;
    }