//prewritten code: https://github.com/antma/algo
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.traits;

int f (int x) {
  return (x * (x - 1) ) / 2;
}

void main() {
  int n = readln.strip.to!int;
  int[26] c;
  foreach (i; 0 .. n) {
    auto s = readln;
    ++c[s[0].to!int - 97];
  }
  int res;
  foreach (i; 0 .. 26) {
    int m = c[i] >> 1;
    res += f (m) + f (c[i] - m);
  }
  writeln (res);
}

