#include #include using namespace std; int main(int argc, char ** argv) { int n; set mm; while(scanf("%d\n", &n) == 1) { char c; uint32_t temp; for (int i = 0; i < n; ++i) { temp = 0; while(scanf("%c", &c) == 1 && c != '\n') { temp |= (1 << (c - '0')); } mm.insert(temp); } cout << mm.size() << endl; mm.clear(); } return 0; }