import java.util.HashMap;
class Solution {
public int solution(String[][] clothes) {
HashMap<String, Integer> hm = new HashMap<>();
for (int i = 0; i < clothes.length; i++) {
int num = hm.getOrDefault(clothes[i][1], 0);
hm.put(clothes[i][1], num + 1);
}
int answer = 1;
for (String k : hm.keySet()) {
answer *= (hm.get(k) + 1);
}
return answer - 1;
}
}