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

typedef struct _list {
  char str[11];
  int len;
  struct _list *next;
}List;

int main(void) {

  int n;
  scanf("%d", &n);
  List *list = calloc(1, sizeof(List));
  int list_num = 0;
  for(int i = 0;i < n;i++) {
    char s[11];
    scanf("%s", s);
    int count = 1;
    for(List *data = list;data != NULL;data = data->next) {
      if(s[0] == data->str[0] && strlen(s) == data->len) {
        if(strcmp(s, data->str) == 0) {
          count = 0;
          break;
        }
      } else {
        if(s[0] > data->str[0]) {
          break;
        }
      }
    }
    if(count != 0) {
      List *data = list;
      int flag = 0;
      while(data != NULL) {
        if(s[0] == data->str[0]) {
          List *l = calloc(1, sizeof(List));
          strcpy(l->str, s);
          l->len = strlen(s);
          l->next = data->next;
          data->next = l;
          flag = 1;
          break;
        } else {
          if(s[0] < data->str[0]) continue;
          if(s[0] > data->str[0]) break;
        }
        data = data->next;
      }
      if(!flag) {
        List *l = calloc(1, sizeof(List));
        strcpy(l->str, s);
        l->len = strlen(s);
        l->next = list;
        list = l;
      }
      list_num++;
    }
  }
  printf("%d\n", list_num);

  return 0;
}
