#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
  int N, len_sorted;
  char S[2 * 100000][11];
  char sorted[2 * 100000][11];

  scanf("%d", &N);
  len_sorted = 0;
  for (int i = 0; i < N; i++)
  {
    // printf("------------------\n");

    char input_tmp[11];
    scanf("%s", input_tmp);

    int max = len_sorted - 1;
    int min = 0;
    int mid = -1;

    while (1)
    {
      mid = (max + min) / 2;

      if (len_sorted == 0)
      {
        strcpy(sorted[0], input_tmp);
        len_sorted++;
        break;
      }

      int cmp = strcmp(input_tmp, sorted[mid]);
      // printf("%d %d %d  %d => ", min, mid, max, cmp);
      if (cmp == 0)
      {
        break;
      }
      else if (cmp > 0)
      {
        min = mid + 1;
      }
      else
      {
        max = mid - 1;
      }
      // printf("%d %d %d\n", min, mid, max);

      if (max < min)
      {
        int insert = min;

        // printf("insert: %d\n", insert);

        for (int j = len_sorted; j >= insert && j != 0; j--)
        {
          strcpy(sorted[j], sorted[j - 1]);
        }
        strcpy(sorted[insert], input_tmp);
        len_sorted++;

        break;
      }
    }

    /*
    for (int j = 0; j < len_sorted; j++)
    {
      printf("%s, ", sorted[j]);
    }
    printf("\n");
    */
  }

  printf("%d", len_sorted);

  return 0;
}
