#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main() {
  string S;
  cin >> S;
  int ans = 0;
  int N = S.size();
  int cnt0 = 0, cnt1 = 0;
  for (int i = 0; i < int(N); ++i) {
    if (S[i] == '0')
      cnt0++;
    else
      cnt1++;
    if (cnt0 == cnt1) ans = cnt0 * 2;
  }
  cout << ans << endl;
}
