#include<bits/stdc++.h>
#define MAXN (int)(1e4+1e1)
using namespace std;
struct node{
int x[30];
node(string s){
for(int i=1;i<=s.size();i++) x[s[i]-'a'+1]++;
}
friend bool operator == (node a,node b){
for(int i=1;i<=26;i++) if(a.x[i]!=b.x[i]) return false;
return true;
}
}ar[MAXN],m;
int n,t;
string x[MAXN];
bool isf;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++){
isf=true;
cin>>x[i];
m=node(x[i]);
for(int i=1;i<=t;i++) if(ar[i]==m) isf=false;
if(isf){
t++;
ar[t]=m;
}
}
cout<<t<<endl;
return 0;
}