#include <stdio.h>
#include <stdlib.h>
struct Node {
    int data;
    struct Node* next;
};
struct node* createNode(int data) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = data;
    newNode->next = NULL;
    return newNode;
}
int search(struct Node* head, int x) {
    int position = 1;
    struct Node* temp = head;
    while (temp != NULL) {
        if (temp->data == x)
        return position;
        temp = temp->next;
        position++;
    }
    return -1;
}
int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1 || n > 100) {
        printf("Invalid input");
        return 0;
    }
    struct Node *head = NULL, *temp = NULL;
    for (int i = 0; i < n; i++) {
        int value;
        if (scanf("%d", &value) != 1 || value <= -1000 || value >= 1000) {
            printf("Invalid input");
            return 0;
        }
        struct Node* newNode = createNode(value);
        if (head == NULL) {
            head = newNode;
            temp = head;
        } else {
            temp->next = newNode;
            temp = newNode;
        }
    }
    int x;
    if (scanf("%d", &x) != 1 || x <= -1000 || x >= 1000) {
        printf("Invalid input");
        return 0;
    }
    int result = search(head, x);
    printf("%d", result);
    return 0;
}