#include <bits/stdc++.h>
using namespace std;
int gcm(int a, int b);
int main() {
  string s;
  cin >> s;
  int ans = 0;
  int have0 = 0;
  int have1 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0' && have1) {
      ans += 2;
      have1--;
    } else if (s[i] == '1' && have0) {
      ans += 2;
      have0--;
    } else if (s[i] == '1' && !(have0)) {
      have1++;
    } else if (s[i] == '0' && !(have1)) {
      have0++;
    }
    cout << have0 << ' ' << have1 << endl;
  }
  cout << ans << endl;
}
int gcm(int a, int b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcm(a % b, b);
}
