#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int ans = 0;
  string s;
  cin >> s;
  char c = 'n';
  int f_i = -1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '2') {
      ;
    } else if (c == '1' && s[i] == '0') {
      ans += 2;
      c = 'n';
      s[i] = '2';
      s[f_i] = '2';
      i = -1;
      f_i = -1;
      cout << s << endl;
    } else if (c == '0' && s[i] == '1') {
      ans += 2;
      c = 'n';
      s[i] = '2';
      s[f_i] = '2';
      i = -1;
      f_i = -1;
    } else {
      c = s[i];
      f_i = i;
    }
  }
  cout << ans << endl;
  return 0;
}
