#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int A, B, C, N, M, odd = 0, sum = 0;
  vector<int> P(26, 0);
  string S;
  cin >> S;
  A = S.size();
  sort(S.begin(), S.end());
  for (long long int i = 0; i < A; i++) P[S[i] - 97]++;
  for (long long int i = 0; i < 26; i++)
    if (P[i] != 0) sum += P[i] - 1;
  cout << sum << endl;
}
