#include <bits/stdc++.h>
using namespace std;
int main() {
  int kais = 0;
  string s;
  cin >> s;
  while ((int)s.find("10") >= 0) {
    if ((int)s.find("10") >= 0) {
      s.replace(s.find("10"), 2, "");
      kais = kais + 1;
    }
  }
  cout << kais * 2;
  system("pause");
  return 0;
}
