#include #include #include #include #include using namespace std; typedef long long ll; int Hash[30]; map mp; char str[50]; char tmp[100]; int main() { //freopen("in.txt", "r", stdin); int n; scanf("%d", &n); for(int i = 1; i <= n; i++) { memset(Hash, 0, sizeof(Hash)); scanf("%s", str); int len = strlen(str); for(int i = 0; i < len; i++) Hash[str[i] - 'A']++; for(int i = 0; i < 26; i++) { tmp[2 * i] = Hash[i] / 10 + '0'; tmp[2 * i + 1] = Hash[i] % 10 + '0'; } tmp[52] = '\0'; //puts(tmp); printf("%d\n", mp[tmp]); mp[tmp]++; } return 0; }