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

struct collect{
	char s[11];
	struct collect *next;
};

int condition(struct collect *p, char *a, int index){
	/*data が key 以上であれば、1を返し、key未満であれば0を返す。*/
	int i =0;
	for(i = 0; i < index; i++){
		p = p->next;
	}
	if(strcmp(p->s, a) >= 0){
		return 1;
	}
	return 0;
}

int myAbs(int a){
	if(a < 0) a = -a;
	return a;
}

void insert(struct collect *p, char S[ ]){
	struct collect *q;
	q = (struct collect *)malloc(sizeof(struct collect));
	strcpy(q->s, S);
	q->next = p->next;
	p->next = q;
}

int MeguruBinarySearch(struct collect *p , int size, char *key){
	/*二分探索で条件を満たすindexを探す*/
	/*condition の条件式がdataがkey以上になるとokが更新されるので、key以上となる最小のindexをかえす。*/
	int ng = -1;
	int ok = size;
	int mid;
	while(myAbs(ok - ng) > 1){
		mid = (ok + ng)/2;
		
		if(condition(p, key, mid)) ok = mid;
		else ng = mid;
	}
	return ok;
}
/*
void insert(char ** buf, char *s, int k){
	int i = 0, j = 0;
	i = MeguruBinarySearch(buf, k, s);
	for(j = k - 1; j - i > 0; j--){
		strcpy(buf[ j+1 ], buf[ j ]);
	}
	strcpy(buf[i], s);
}
*/
int main(){
	int N;
	scanf("%d", &N);
	struct collect *buf, *p, *printer;
	buf = (struct collect *)malloc(sizeof(struct collect));
	buf->next = NULL;
	p = buf;
	int i = 0, j = 0, k = 0, count = 0, index = 0;
	char a[11];
	scanf("%s", p->s);
	k++; count++;
	
	for(i = 1; i < N; i++){
		scanf("%s", a);
		
		index = MeguruBinarySearch(buf, k, a);
		//printf("%d\n", index);
		p = buf;
		for(j = 0; index - j > 0; j++){
			if(p->next == NULL)break;
			p = p->next;
		}
		if(strcmp(p->s, a) != 0){
			printer = buf;
			insert(p, a);
			k++;
			count++;
			/*for(j = 0; j < k; j++){
				printf("%d個目 = %s\n", j, printer->s);
				printer = printer->next;
			}*/
		}
	}
	printf("%d\n", count);
	return 0;
}