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