#include <bits/stdc++.h>
using namespace std;
template <typename T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <typename T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
const long long INF = 1e+18;
const double EPS = 1e-9;
const long long MOD = 1000000007;
const long long dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
signed main() {
  long long n, ans = 0, cnt = 0;
  string s;
  cin >> s;
  n = s.length();
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0')
      cnt++;
    else if (s[i] == '1' && cnt >= 0) {
      cnt--;
      ans += 2;
    }
  }
  cout << ans << endl;
}
