#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 = serach(head, x);
    printf("%d\n", result);
    struct Node* temp;
    while (head != NULL){
        temp = head;
        head = head->next;
        free(temp);
    }
    return 0;
}