#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
struct node
{
    char data[100];
    struct node *next;
};
int IsDigit(const char *str)
{
    int i;
    for(i=0;str[i]!='\0';i++)
    {
        if(IsDigit((unsigned char)str[i]))
        {
            return 1;
        }
    }
    return 0;
}
int main()
{
    int n,i;
    struct node *start=NULL;
    struct node *temp=NULL;
    struct node *current=NULL;
    scanf("%d",&n);
    start=(struct node*)malloc(sizeof(struct node));
    scanf("%\n",start->data);
    start->next=NULL;
    current=start;
    for(i=2;i<=n;i++)
    {
        temp=(struct node*)malloc(sizeof(struct node));
        scanf("%\n",temp->data);
        temp->next=NULL;
        current->next=temp;
        current=temp;
    }
    struct node *searchnode;
    searchnode=(struct node*)malloc(sizeof(struct node));
    scanf("%\n",searchnode->data);
    searchnode->next=NULL;
    current=start;
    for(i=1;i<=n;i++)
    {
        if(IsDigit(current->data))
        {
            printf("Invalid input");
            return 0;
        }
        current=current->next;
    }
    if(IsDigit(searchnode->data))
    {
        printf("Invalid input");
        return 0;
    }
    current = start;
    int found=0;
    int pos=1;
    while(current!=NULL)
    {
        if(strcmp(current->data,searchnode->data)==0)
        {
            printf("%d",pos);
            found=1;
            break;
        }
        current=current->next;
        pos++;
    }
    if(!found)
    {
        printf("Title not found");
    }
    return 0;
}