#include #include #include #include int main() { int N; std::set myset; while(scanf("%d",&N) > 0){ char akt[30]; int j; for (j = 0; j < N; j++) { scanf("%s",akt); int q[10] = {0}; for (unsigned int i = 0; i < strlen(akt); i++) { if((q[akt[i] - '0'] == 0)) { //printf("%d %d\n",akt[i] - '0',q[akt[i] - '0']); q[akt[i] - '0'] = 1; } } int result = 0; for(int a = 1; a <= 10; a++) { if(q[a] == 1) { result += a; result *= 10; } } result /= 10; if(result != 0) { //printf("%d\n",result); myset.insert(result); } } std::cout << myset.size() <<"\n"; myset.clear(); } return 0; }