#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int dp[maxn][2];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  dp[0][0] = 1;
  dp[1][1] = 1;
  for (int i = 0; s[i]; ++i) {
    if (i - 1 >= 0) {
      if (s[i] != s[i - 1]) dp[i][0] = max(dp[i][0], dp[i - 1][0] + 1);
      dp[i][0] = max(dp[i][0], dp[i - 1][1] + 1);
    }
    if (i - 2 >= 0) {
      if (s[i] != s[i - 2] && s[i - 1] != s[i - 3])
        dp[i][1] = max(dp[i][1], dp[i - 2][1] + 1);
      dp[i][1] = max(dp[i][1], dp[i - 2][0] + 1);
    }
    cout << dp[i][1] << " " << dp[i][0] << endl;
  }
  int len = s.length();
  cout << max(dp[len - 1][0], dp[len - 1][1]) << endl;
}
