/* * File: balloon.cpp * Author: cteam003 * * Created on October 22, 2016, 9:18 AM */ #include #include #include #include #include #include using namespace std; /* * */ int main(int argc, char** argv) { int count; string str; while(cin >> count) { map result; for (int i = 0; i < count; i++) { cin >> str; set tmp; for (char c : str) tmp.insert(c); str = ""; for (char c : tmp) str += c; if (result.count(str) == 0) result[str] = 1; else result[str] = result[str] + 1; } cout << result.size() << endl; } return 0; }