#include <bits/stdc++.h>
using namespace std;
long long r(long long x) {
  if (x == 0)
    return 1;
  else
    return 0;
}
int main(void) {
  string s;
  cin >> s;
  long long n = s.length();
  long long a[n];
  for (long long i = 0; i < n; ++i) a[i] = atoi(s.substr(i, 1).c_str());
  long long c0 = 0, ans = 0;
  long long x = a[0], y = r(x);
  for (long long i = 0; i < n; ++i) {
    if (a[i] == x) ++c0;
    if (a[i] == y && ans < c0) ++ans;
  }
  ans *= 2;
  cout << ans << endl;
}
