#include <stdio.h>
int main(){
  int n;
  int i=0;
  scanf("%d", &n);
  char s1[100], s2[100];
  int count=0;
  scanf("%s", s1);
  for(int j=0;j<n-1;++j){
      scanf("%s", s2);
  while(s1[i]!='\0' || s2[i]!='\0'){
      if(s1[i]!=s2[i]){
        count++;
        for(int k=0;k<i;++k){
          s1[k]=s2[k];
        }
      break;
    }
    i++;
  }
}
  printf("%d", count+1);
  return 0;
}
