#include <bits/stdc++.h>
int main(void) {
  int i, j, k;
  int answer, length = 0;
  char s[200001];
  short pairs[200001][2];
  int pairCount = 0;
  int strLength = 1;
  scanf("%s", s);
  for (i = 0; s[i] != '\0'; i++) {
  }
  length = i;
  bool flag = false;
  for (i = 0; i < length; i++) {
    flag = false;
    for (j = 0; j < pairCount; j++) {
      if (strLength == (pairs[j][1] - pairs[j][0] + 1)) {
        for (k = 0; k < strLength; k++) {
          if (k == (strLength - 1) && s[i + k] == s[pairs[j][1]]) {
            flag = true;
          } else {
            if (s[i + k] != s[pairs[j][0] + k]) {
              break;
            }
          }
        }
      }
    }
    if (flag == false) {
      pairs[pairCount][0] = i;
      pairs[pairCount][1] = i + strLength - 1;
      printf("%d   %d\n", i, i + strLength - 1);
      i += (strLength - 1);
      strLength = 1;
      pairCount++;
    } else {
      strLength++;
      if ((i + strLength - 1) == length) {
        break;
      }
      i--;
    }
  }
  printf("%d\n", pairCount);
  return 0;
}
