#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;
int main() {
  string S;
  cin >> S;
  int64_t z = 0, o = 0;
  int64_t ans = 0;
  int64_t cnt = 0;
  for (int64_t i = 0; i < S.size(); i++) {
    char ch = S[i];
    if (ch == '0')
      z++;
    else {
      if (z) {
        z--;
        cnt++;
      }
    }
  }
  ans = max(2 * cnt, ans);
  cnt = 0;
  for (int64_t i = 0; i < S.size(); i++) {
    char ch = S[i];
    if (ch == '1')
      o++;
    else {
      if (o) {
        o--;
        cnt++;
      }
    }
  }
  ans = max(2 * cnt, ans);
  cout << ans << endl;
}
