#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0, k = 0, l = 0, m;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == s[i + 1]) {
      k++;
    } else {
      ans += 1 + 2 * (k / 3);
      if (k % 3 == 2) ans++;
      m = k % 3;
      if (l == 1) {
        if (m == 1) {
          ans++;
          m--;
        } else if (m == 2)
          m--;
      }
      l = m;
      k = 0;
    }
    cout << ans << endl;
  }
  ans += 1 + 2 * k / 3;
  if (k % 3 == 2) ans++;
  m = k % 3;
  if (l == 1 && m == 1) ans++;
  cout << ans << endl;
  return 0;
}
