#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
const ll mod = 1000000007;
const ll INF = 1000000099;
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
signed main() {
  string s;
  cin >> s;
  ll k = 1, ans = 1;
  int mae = 1;
  for (ll i = 1; i < (ll)(s).size(); i++) {
    if (s[i] == s[i - 1] && mae == 1) {
      i++;
      mae = 2;
      if (i == (ll)(s).size()) k--;
    } else {
      mae = 1;
    }
    k++;
  }
  ans = k;
  reverse((s).begin(), (s).end());
  k = 1;
  for (ll i = 1; i < (ll)(s).size(); i++) {
    cout << i << endl;
    if (s[i] == s[i - 1] && mae == 1) {
      i++;
      mae = 2;
      if (i == (ll)(s).size()) k--;
    } else {
      mae = 1;
    }
    k++;
  }
  ans = max(ans, k);
  cout << ans << endl;
}
