#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 (c == '1' && s[i] == '0') {
      ans += 2;
      c = 'n';
      cout << s << "  " << f_i << i << endl;
      s.erase(i, 1);
      s.erase(f_i, 1);
      i = max(f_i - 2, -1);
      f_i = -1;
    } else if (c == '0' && s[i] == '1') {
      ans += 2;
      c = 'n';
      cout << s << "  " << f_i << endl;
      s.erase(i, 1);
      s.erase(f_i, 1);
      i = max(f_i - 2, -1);
      f_i = -1;
    } else {
      c = s[i];
      f_i = i;
    }
  }
  cout << ans << endl;
  return 0;
}
