#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ss(x) (int) x.size()
#define cat(x) cerr << #x << " = " << x << endl
#define rep(i, l, r) for (int i = l; i <= r; ++i)
#define per(i, l, r) for (int i = r; l <= i; --i)

using ll = long long;
using namespace std;

string s;
int cnt[26];
 
int main() {
	cin >> s;
	for (auto x : s)
		cnt[x - 'a']++;
	ll res = 0;
	rep(i, 0, 25)
		rep(j, i + 1, 25)
			res += 1LL * cnt[i] * cnt[j];
	cout << res + 1 << endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;

int main() {
  string S;
  cin>>S;
  vector<int64_t> A(26,0);
  int64_t a=-97,b=S.size();
  rep(i,b){
    int64_t c=S.at(i);
    A.at(a+c)++;
  }
  int64_t ans=b*(b-1)/2;
  rep(i,26){
    int64_t d=A.at(i);
    if(d>1) ans-=d*(d-1)/2;
  }
  cout<<ans+1;
}
