// editor4
#include<stdio.h>
#include<stdlib.h>
#include<string.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 valid=0,pos=1;
    while(temp!=NULL)
    {
        if(strcmp(temp->data,data)==0)
        {
            valid =1;
            temp=temp->next;
            break;
        }
        else{
            pos++;
            temp=temp->next;
        }
    }
    if(valid==0)
    {
        printf("Title not found");
        return ;
    }
    else
    {
        printf("%d",pos);
    }
}
int main()
{
    int n;
    struct Node *head;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        char data[50];
        (scanf("%[^\n]",data);
        insert(data,&head);
        
    }
    char data[50];
    scanf("%[^\n]",data);
    search(data,head);
    
}