You are on page 1of 1

#include <iostream>

#include <map>
#include <set>

using namespace std;

int main()
{
map<string, set<string> > bouquet;
int n, ans=0;
cin >> n;
for(int i=0; i<n; i++) {
string tree, color;
cin >> tree >> color;
if(bouquet[tree].count(color) == 0) {
ans++;
bouquet[tree].insert(color);
}
}
cout << ans;
}

You might also like