#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int g1, g2;
  map<char, int> m;
  if (n % 2 == 0) {
    g1 = n / 2;
    g2 = n / 2;
  } else {
    g1 = n / 2 + 1;
    g2 = n / 2;
  }
  for (int i = 97; i <= 122; i++) {
    char d = (char)i;
    m[d] = 0;
  }
  while (n--) {
    string s;
    cin >> s;
    char c = s[0];
    m[c]++;
  }
  int c = 0;
  for (int i = 97; i <= 122; i++) {
    char d = (char)i;
    int x = m[d];
    int x1 = 0, x2 = 0;
    if (x != 0) {
      if (x % 2) {
        x1 = x / 2 + 1;
        x2 = x / 2;
      } else {
        x1 = x / 2;
        x2 = x / 2;
      }
    }
    if (g1 > g2) {
      g1 -= x1;
      g2 -= x2;
    } else {
      g1 -= x2;
      g2 -= x1;
    }
    if (x1 >= 2) {
      c += x1 * (x1 - 1) / 2;
    }
    if (x2 >= 2) {
      c += x2 * (x2 - 1) / 2;
    }
    if (g1 == 0 && g2 == 0) {
      break;
    }
  }
  cout << c << "\n";
  return 0;
}
