Problem: There is a given string S consisting of N symbols. Your task is to find the number of ordered pairs of integers i and j such that

1. 1 ≤ i, j ≤ N

2. S[i] = S[j], that is the i-th symbol of string S is equal to the j-th.

Input

The single input line contains S, consisting of lowercase Latin letters and digits. It is guaranteed that string S in not empty and its length does not exceed 105.

Output

Print a single number which represents the number of pairs i and j with the needed property. Pairs (x, y) and (y, x) should be considered different, i.e. the ordered pairs count.

Examples

Input

great10


Output

7


Input

aaaaaaaaaa


Output

100

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T n) {
  return (n < 0 ? -n : n);
}
template <class T>
T max(T a, T b) {
  return (!(a < b) ? a : b);
}
template <class T>
T min(T a, T b) {
  return (a < b ? a : b);
}
template <class T>
T sq(T x) {
  return x * x;
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <class T>
bool inside(T a, T b, T c) {
  return a <= b && b <= c;
}
template <class T>
void setmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void setmin(T &a, T b) {
  if (b < a) a = b;
}
const double EPS = 1e-9;
const double BIG = 1e19;
const int INF = 0x7f7f7f7f;
char str[100032];
long long cnt[36], ans;
int main() {
  while (scanf("%s", str) == 1) {
    memset(cnt, 0, sizeof(cnt));
    ans = 0;
    for (int i = 0; str[i]; i++) {
      if (isalpha(str[i]))
        cnt[str[i] - 'a']++;
      else
        cnt[str[i] - '0' + 26]++;
    }
    for (int i = 0; i < 36; i++) ans += cnt[i] * cnt[i];
    printf("%lld\n", ans);
  }
  return 0;
}