#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 20;
long long dp[N][10], n;
string str;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> str;
  n = str.size();
  if (str.size() == 1) {
    cout << 1;
    return 0;
  }
  if (n == 2) {
    if (str[0] == str[1])
      cout << 1;
    else
      cout << 2;
    return 0;
  }
  if (str[0] == str[1]) {
    dp[1][1] = 0;
  } else
    dp[1][1] = 1;
  dp[1][2] = 1;
  for (long long i = 2; i < n; i++) {
    cout << dp[i][1] << " " << dp[i][2] << endl;
    if (str[i] == str[i - 1])
      dp[i][1] = 1 + dp[i - 1][2];
    else
      dp[i][1] = 1 + max(dp[i - 1][1], dp[i - 1][2]);
    if (i > 2 && str[i] + str[i - 1] == str[i - 2] + str[i - 3])
      dp[i][2] = 1 + dp[i - 2][1];
    else
      dp[i][2] = 1 + max(dp[i - 2][2], dp[i - 2][1]);
    cout << dp[i][1] << " " << dp[i][2] << endl;
  }
  cout << max(dp[n - 1][1], dp[n - 1][2]);
}
