#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int a = 0;
  int b = 0;
  for (auto& s : S) {
    if (s == '0') {
      a++;
    } else {
      b++;
    }
    cout << min(a, b) << endl;
  }
  return 0;
}
