#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<int> cubes;
  for (int i = 0; i < s.size(); i++) {
    cubes.push_back(s[i] - '0');
  }
  int ans = 0;
  bool erased = true;
  while (erased) {
    erased = false;
    for (int i = 0; i < cubes.size(); i++) {
      if (cubes[i] != cubes[i + 1]) {
        cubes.erase(cubes.begin() + i, cubes.begin() + i + 1);
        ans += 2;
        erased = true;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
