#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, count = 0;
  vector<string> v;
  string s;
  cin >> n;
  while (n--) {
    cin >> s;
    v.push_back(s);
  }
  sort(v.begin(), v.end());
  for (i = 0; i < v.size(); i += 2) {
    for (j = i + 2; j < v.size(); j += 2) {
      if (v[i][0] == v[j][0]) count++;
    }
  }
  for (i = 1; i < v.size(); i += 2) {
    for (j = i + 2; j < v.size(); j += 2) {
      if (v[i][0] == v[j][0]) count++;
    }
  }
  cout << count << endl;
  return 0;
}
