#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  vector<int> bin;
  vector<int> tmp;
  bin.push_back(2);
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '0') {
      bin.push_back(0);
    } else if (S[i] == '1') {
      bin.push_back(1);
    }
  }
  bin.push_back(3);
  int answer = 0;
  while (true) {
    tmp.clear();
    for (int i = 0; i < bin.size() - 1;) {
      if (bin[i] + bin[i + 1] == 1) {
        i += 2;
        answer += 2;
      } else {
        tmp.push_back(bin[i]);
        i++;
      }
    }
    tmp.push_back(3);
    if (bin.size() == tmp.size()) {
      break;
    }
    bin = tmp;
  }
  cout << answer << endl;
  return 0;
}
