#include <bits/stdc++.h>
char s[200050];
int main() {
  int n, i = 0, j, ans = 0, t = 1;
  scanf("%s", s);
  n = strlen(s);
  while (i < n) {
    ++t;
    for (j = i; j < i + t - 1; ++j)
      if (s[j] != s[j + 1]) {
        t = 1;
        break;
      }
    ++ans;
    i += t;
  }
  printf("%d", ans);
}
