#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string S;
  cin >> S;
  int N = S.length();
  int r = 0, i, j;
  bool f = true;
  while (f) {
    f = false;
    for (signed i = 0; i < N; i++) {
      if (S.at(i) != '2') {
        for (signed j = i + 1; j < N; j++) {
          if (S.at(j) == S.at(i)) {
            break;
          } else if (S.at(j) == '2') {
            continue;
          } else {
            r += 2;
            S.at(i) = '2';
            S.at(j) = '2';
            f = true;
            break;
          }
        }
      }
    }
  }
  cout << r << endl;
}
