-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA578.java
48 lines (40 loc) · 1.22 KB
/
A578.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.util.HashSet;
import java.util.Set;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class A578 {
//Clase para acelerar la lectura por teclado.
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(
new InputStreamReader(System.in));
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
public static void main(String[] args) throws Exception {
FastReader sc = new FastReader();
while (true) {
Set<String> inventario = new HashSet<>();
int numeroProductos = Integer.parseInt(sc.nextLine());
if (numeroProductos == 0) {
break;
}
for (int i = 0; i < numeroProductos; i++) {
inventario.add(sc.nextLine().toLowerCase());
}
System.out.println(inventario.size());
}
}
}