#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << v[i];
  }
  return os;
}
const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
inline void my_io() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cout << fixed << setprecision(10);
}
signed main() {
  string s;
  stack<ll> st;
  st.push(1);
  ll ans = 0;
  cin >> s;
  for (ll i = (0), __last_i = (s.size()); i < __last_i; i++) {
    if (s[i] == '0') {
      if (st.top()) {
        st.pop();
        ans++;
      } else {
        st.push(0);
      }
    } else {
      if (!st.top()) {
        st.pop();
        ans++;
      } else {
        st.push(1);
      }
    }
  }
  cout << ans * 2 << endl;
}
