#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
struct Node
{
    char data[50];
    struct Node *next;
};
struct Node *create( char data[50])
{
    struct Node newnode=(struct Node)malloc(sizeof(struct Node));
    strcpy(newnode->data,data);
    newnode->next=NULL;
    return newnode;
}
void insert(char data[50],struct Node **head)
{
    struct Node *newnode=create(data),*temp=*head;
    if(*head==NULL)
    {
        *head=newnode;
    }
    else
    {
        while(temp->next!=NULL)
        {
            temp=temp->next;
        }
        temp->next=newnode;
    }
}
void search(char data[50], struct Node *temp)
{
    int pos = 0,valid=0;  
    while(temp!=NULL)
    {
        if(strcmp(temp->data,data)==0)
        {
            printf("%d",pos);
            valid=1;
        }
        pos++;
        temp=temp->next;
    }
    if(valid==0)
    {
        printf("Title not found");
    }
}
int main()
{
    int n,i,j;
    struct Node *head = NULL;  
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char data[50];
        scanf(" %[^\n]",data);
        for(j=0;j<strlen(data);j++)
        {
            if(isdigit(data[j])!=0)
            {
                printf("Invalid input");
                return 0;
            }
        }
        insert(data,&head);
        
    }
    char data[50];
    scanf(" %[^\n]s",data);
    search(data,head);
}