#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<vector<string>> clothes) {
int answer = 1;
int len = clothes.size();
vector<string> save;
string str;
for(int i = 0; i<len; i++){
str = clothes.at(i).at(1);
save.push_back(str);
}
sort(save.begin(), save.end());
int num1 = 0;
vector<int> num;
num.resize(30);
num[0] = 1;
for(int i = 1; i<len; i++){
if(save[i-1]==save[i]){
num[num1] += 1;
}
else{
num1++;
num[num1] += 1;
}
}
for(int i = 0; i<num.size(); i++){
answer *= (num[i]+1);
}
return answer-1;
}