//g++ -std=c++11 -O2 -Wall microwave.cpp -o microwave
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
//COMMENCE CODE
int n;
cin >> n; //N = AMOUNT OF JONOJA
string gayarray [n+1];
//char aakkoset [27] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
for(int jono = 1; jono <= n; jono++)
{
cin >> gayarray[jono];
}
//INPUT COLLECTED, LETS DO STUFF
for(int jono = 1; jono <= n; jono++) //Jokaiselle jonolle
{
string cipher [2]; //0:plain, 1:cipher
cipher[1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //Eka plain = a, toka = b...
int nextPlain = 0;
bool found;
for(unsigned int paikka = 0; gayarray[jono][paikka] != '\0'; paikka++) //jokaiselle paikalle [!]RISKI ;-;
{
found = false;
for(int r = 0; r < nextPlain; r++)
{
if(cipher[0][r] == gayarray[jono][paikka]) //Jos kirjanin on cipheris
{
gayarray[jono][paikka] = cipher[1][r];
found = true;
break;
}
}
if(!found) //Jos ei ole cipheris, adaa se
{
cipher[0][nextPlain] = gayarray[jono][paikka];
//adattu, vaihda viel nykyne kirjain
gayarray[jono][paikka] = cipher[1][nextPlain];
nextPlain++;
}
}
}
//JONOT REKONSTRUOITU, COMMENCE VERTAILU
int count = 0;
for(int vertaaja = 1; vertaaja <= n; vertaaja++)
{
for(int verrattava = vertaaja + 1; verrattava <= n; verrattava++)
{
if(gayarray[vertaaja] == gayarray[verrattava])
{
count++;
}
}
}
cout << count;
}