#include <bits/stdc++.h>
using namespace std;
char str[200001];
int a[36];
int main() {
  scanf("%s", str);
  int n = strlen(str);
  memset(a, 0, sizeof(int) * 36);
  for (int i = 0; i < n; i++) {
    if (str[i] < 'a')
      a[str[i] - '0']++;
    else
      a[str[i] - 'a' + 10]++;
  }
  long long ans = 0LL;
  for (int i = 0; i < 36; i++) {
    ans += (long long)a[i] * (long long)a[i];
  }
  cout << ans << endl;
  return 0;
}
