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.
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 10<sup class="upper-index">5</sup>.
#include <bits/stdc++.h>
using namespace std;
#define int long long
// Debugging:


// using ll = long long;
using ld = long double;
using pii = pair<int, int>;
template<class T> using MaxHeap = priority_queue<T, vector<T>,    less<T>>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

const int maxN = 1e5 + 2;
const int MOD = 998244353;
const int INF = 1e9 + 7;
// const ll LINF = 1e18;
int binpow(int a, int b) {
	int res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a;
		a = a * a;
		b >>= 1;
	}
	return res;
}
map<char, int> mp;
void solve() {
	string s;
	cin >> s;
	int ans = 0;
	for (int i = 0; i < s.size(); ++i) {
		mp[s[i]]++;
	}
	for (auto it = mp.begin(); it != mp.end(); ++it) {
		ans += binpow(it->second, 2);
	}
	cout << ans;
}

int32_t main() {
	cin.tie(0)->sync_with_stdio(false);

	int t = 1;
	// cin >> t;
	while (t--) {
		solve();
	}
	cout << '\n';

	return 0;
}
// -~.-~-.-~-| Eustia Tia Astraea |-~.-~-.-~-