#include <bits/stdc++.h>
using namespace std;
char word[100010];
long long countt[100];
int main() {
  scanf("%s", &word);
  for (int i = 0; i <= 9 + 30; i++) countt[i] = 0;
  int N = strlen(word);
  for (int i = 0; i < N; i++)
    countt[(word[i] >= '0' && word[i] <= '9' ? word[i] - '0'
                                             : word[i] - 'a' + 10)]++;
  long long answer = 0;
  for (int i = 0; i <= 9 + 30; i++) answer += countt[i] * countt[i];
  printf("%lld\n", answer);
}
