// editor4
#include <stdio.h>
#include <stdlib.h>
struct node
{
     char s1[100];
    struct node* next;
};
int main()
{
    int n,i;
    scanf("%d",&n);
    struct node* head=NULL,*temp;
    for(i=0;i<n;i++)
    {    struct node* newnode=(struct node*)malloc(sizeof(struct node));
   
       scanf("%s",newnode->s1);
       int j;
       for(j=0;newnode->s1[j]!='\0';j++)
       {
           char ch=newnode->s1[j];
             if(!((ch>='A'&&ch<='Z')||(ch>='a'&&ch<='z'))
           {
               printf("Invalid input");
               return 0;
           }
          
       }
     
        newnode->next=NULL;
        if(head==NULL)
        {
            head =newnode;
            temp=newnode;
        }
        else
        {
        
        temp->next=newnode;
       temp=newnode;
   }
   }
   int c=1,flag=0;;
   struct node* x=head;
   char s2[100];
   scanf("%s",s2);
   while(x)
   {
      if(strcmp(x->s1,s2)==0);
      {
          flag=1;
          printf("%d",c);
          return 0;
      }
      c++;
      x=x->next;
   }
   if(flag==0)
   printf("Title not found");
}