#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    struct node* next;
};
int search(struct node*head,int x){
    struct 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,x, value;
    scanf("%d", &n);
    struct node*head = NULL;
    struct node*tail = NULL;
    for(int i = 0; i < n; i++){
        scanf("%d", &value);
        struct node*newnode = (struct node*)malloc(sizeof(struct node));
        newnode ->data= value;
        newnode ->next = NULL;
        if(head == NULL){
            head = newnode;
            tail = newnode;
        }else {
            tail ->next = newnode;
            tail = newnode;
        }
    }
    scanf("%d", &x);
    int result = search(head, x);
    printf("%d\n", result);
    struct Node*temp;
    while(head != NULL){
        temp = head;
        head = head->next;
        free(temp);
    }
    return 0;
}