#include <iostream.h>
#include <string.h>

void readarr(int n,char x[20][30])

{
 for(int i=0;i<=n-1;i++)
    {
     cout<<"x["<<i<<"]=";
     cin >>x[i];
    }
}

int maxlen(int n,char x[20][30])

{
   int p;
 p = (strlen(x[0]) / 2);
 for(int i=1;i<=n-1;i++)
     {
      if (p > (strlen(x[i]))/2);
      p = (strlen(x[i]) / 2);
     }
 return p;
}
              
int main()

{
   int n;
 cin >> n;
 if (!cin)
    {
     cout<<"Error\n";
     return 1;
    }
 if (n > 20)
    {
     cout<<"Error\n";
     return 1;
    }
 if (n < 2)
    {
     cout<<"Error\n";
     return 1;
    }        
   char x[20][30];
 readarr(n,x);
 cout <<maxlen(n,x);
 return 0;
 }
   
   
    
    
   
    


    
     