#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main()
{
int n; cin >> n;
vector<string> sanat;
string temp;
for(int i = 0; i < n; i++)
{
cin >> temp;
sort(temp.begin(), temp.end());
sanat.push_back(temp);
}
//for(string c : sanat)
// cout << c << '\n';
// maybe sort each word and then check for letter amounts
int ans = n;
for(int i = 0; i < n; i++)
{
char prev = ' ';
for(char c : sanat[i])
{
if(prev == ' ')
{
prev = c;
continue;
}
if(c==prev)
{
cont = true;
prev = ' ';
continue;
}
else
{
ans--;
break;
}
}
}
cout << ans << '\n';
return 0;
}