#include <bits/stdc++.h>
using namespace std;
int cnt[36];
int main() {
  string s;
  cin >> s;
  int n = s.length();
  string t = "";
  for (char c = 'a'; c <= 'z'; ++c) {
    t += c;
  }
  for (char c = '0'; c <= '9'; ++c) {
    t += c;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 36; ++j) {
      if (s[i] == t[j]) {
        ++cnt[j];
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < 36; ++i) {
    ans += 1LL * cnt[i] * cnt[i];
  }
  cout << ans << '\n';
  return 0;
}
