#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  vector<int> v((int)s.size());
  for (int i = 0; i < (int)s.size(); ++i) {
    char ch = s[i];
    v[i] = atoi(&ch);
  }
  int count = 0;
  int update;
  do {
    update = 0;
    int prev_id = 0;
    bool init_flag = false;
    for (int i = 0; i < (int)s.size(); ++i) {
      if (v[i] == 100) {
        continue;
      }
      if (init_flag == false) {
        prev_id = i;
        init_flag = true;
      } else {
        if (v[prev_id] != v[i]) {
          v[i] = v[prev_id] = 100;
          count += 2;
          update = 1;
          break;
        } else {
          prev_id = i;
        }
      }
    }
  } while (update == 1);
  cout << count;
}
