Problem:
Score : 300 points

Problem Statement

You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.

How many kinds of items did you get?

Constraints

1 \leq N \leq 2\times 10^5

S_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N
S_1
:
S_N

Output

Print the number of kinds of items you got.

Sample Input 1

3
apple
orange
apple

Sample Output 1

2

You got two kinds of items: apple and orange.

Sample Input 2

5
grape
grape
grape
grape
grape

Sample Output 2

1

Sample Input 3

4
aaaa
a
aaa
aa

Sample Output 3

4

Solution in C (GCC 9.2.1) (judge verdict: Accepted)

#include <stdio.h>

#define HASH 10007

typedef struct List {
	struct List *next;
	char s[11];
} list;

int hash_string(char* s)
{
	long long x = 0;
	int i;
	for (i = 0; s[i] != 0; i++) {
		x += s[i] - 'a';
		x = x << 5;
	}
	return x % HASH;
}

int lex_smaller(char* s1, char* s2)
{
	int i;
	for (i = 0; s1[i] != 0 && s2[i] != 0; i++) {
		if (s1[i] < s2[i]) return 1;
		else if (s1[i] > s2[i]) return -1;
	}
	if (s1[i] == s2[i]) return 0;
	else if (s1[i] == 0) return 1;
	else return -1;
}

int main()
{
	int h, i, j, N, count = 0;
	char S[11];
	list *p, *hash[HASH] = {}, d[200001];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		scanf("%s", S);
		h = hash_string(S);
		for (p = hash[h]; p != NULL; p = p->next) if (lex_smaller(p->s, S) == 0) break;
		if (p == NULL) {
			count++;
			for (j = 0; S[j] != 0; j++) d[i].s[j] = S[j];
			d[i].s[j] = 0;
			d[i].next = hash[h];
			hash[h] = &(d[i]);
		}
	}
	printf("%d\n", count);
	fflush(stdout);
	return 0;
}