#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
string S;
int flag, L, i, j, cnt;
inline void solve() {
  cin >> (S);
  L = S.size();
  while (true) {
    for (((i)) = (0); ((i)) < ((L - 1)); ((i))++) {
      if (S[i] == '_') continue;
      for (j = i + 1; j < L; j++) {
        if (S[j] == '_') continue;
        if ((S[i] == '1' && S[j] == '0') || (S[i] == '0' && S[j] == '1')) {
          S[i] = '_';
          S[j] = '_';
          cnt += 2;
          i = j;
          break;
        }
      }
    }
    flag = 0;
    for (((i)) = (0); ((i)) < ((L)); ((i))++) {
      if (S[i] == '1') flag |= 1;
      if (S[i] == '0') flag |= 2;
    }
    if (flag < 3) break;
  }
  cout << (cnt) << endl;
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return EXIT_SUCCESS;
}
