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