#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int running = 0;
  int count = 0;
  for (char c : s) {
    if (c == '0') {
      ++running;
    } else if (c == '1' && running > 1) {
      --running;
      ++count;
    }
  }
  cout << 2 * count << endl;
  return 0;
}
