public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
char ch = st.nextToken().charAt(0);
HashSet<String> hs = new HashSet<>();
while (n-- > 0) {
hs.add(br.readLine());
}
int ans = hs.size();
switch (ch) {
case 'F':
ans /= 2;
break;
case 'O':
ans /= 3;
break;
default:
break;
}
System.out.print(ans);
}
출처:https://www.acmicpc.net/problem/25757