#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int num = 0;
  vector<char> x;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    x.push_back(s[i]);
  }
  for (int y = 0; y < x.size(); y++) {
    for (int i = 0; i < x.size() - 1; i++) {
      if ((x[i] == '0') && (x[i + 1] == '1')) {
        x.erase(x.begin() + i, x.begin() + (i + 1));
        num += 2;
      }
    }
  }
  cout << num;
}
