#include<stdio.h>
#include<stdlib.h>
int main() {
    int n;
    while (scanf("%d", &n) != EOF) {
        int inf[n];
        for (int i = 0; i < n; i++) {
            scanf("%d", inf + i);
        }
        int x, result = -1;
        scanf("%d", &x);
        for (int i = 0; i < n; i++) {
            if (inf[i] == x)
                result = i;
        }
        printf("%d", result);
    }
    return 0;
}