#include <bits/stdc++.h>
using namespace std;
int main() {
  std::string S;
  cin >> S;
  int cnt = 0;
  int N = S.length();
  for (cnt = 0; cnt < N / 2; cnt++) {
    bool f = true;
    for (int i = 0; i < S.length() - 1; i++) {
      if ((S[i] == 48 && S[i + 1] == 49) || (S[i] == 49 && S[i + 1] == 48)) {
        S.erase(S.begin() + i);
        S.erase(S.begin() + i);
        f = false;
      }
    }
    if (f) break;
  }
  cout << cnt * 2 << endl;
  return 0;
}
