#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug &operator<<(const c &) {
    return *this;
  }
};
int cnt = 0;
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  int i = 0, j = n - 1, cnt0 = 0, cnt1 = 0;
  while (s[i] == '1') i++;
  while (s[j] == '0') j--;
  for (int k = i; k <= j; ++k) {
    if (s[k] == '0')
      cnt0++;
    else
      cnt1++;
  }
  cout << 2 * min(cnt0, cnt1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
