#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int zero_max;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '0') {
      zero_max = i;
      break;
    }
  }
  int count = 0;
  for (int i = zero_max; i >= 0; i--) {
    if (s[i] == '0') {
      for (int j = i + 1; j <= s.size() - 1; j++) {
        if (s[j] == '1') {
          s[i] = s[j] = 2;
          count += 2;
          break;
        }
      }
    }
  }
  cout << count << endl;
}
