#include <bits/stdc++.h>
using namespace std;
string a;
int n;
int cnt;
int c[10010];
int hash(string k){
int t = 0;
for(int i = 0; i < k.size(); i++){
t += k[i] % 5 * 56 % 4 & 5;
}
return t;
}
int main(){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> a;
c[i] = hash(a);
}
sort(c + 1,c + n + 1);
for(int i = 1; i < n; i++){
if(c[i] != c[i + 1]) cnt ++;
}
cout << cnt;
return 0;
}