#include <bits/stdc++.h>
using namespace std;
int counter(int k) {
  if (k == 1) {
    return 1;
  }
  int j = 1;
  while ((k - j) >= 0) {
    cout << k << " " << j << endl;
    k -= j;
    j++;
  }
  return j - 1;
}
int main() {
  string s;
  int k;
  cin >> s;
  int cnt = 1;
  int ans = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == s[i + 1]) {
      cnt++;
      if (i == s.size() - 1) {
        ans += counter(cnt);
      }
    } else {
      ans += counter(cnt);
      if (counter(cnt) * (counter(cnt) + 1) / 2 != cnt) {
        cnt = 0;
        ans++;
      } else {
        cnt = 1;
      }
    }
  }
  cout << ans + 1;
  return 0;
}
