#include <bits/stdc++.h>
int main() {
  char s[200001];
  int i, d = 0;
  char t[200001], v[200001][2];
  strcpy(t, "");
  for (int i = 0; i < 200001; i++) {
    v[i][0] = s[i];
    v[i][1] = '\0';
  }
  scanf("%s", s);
  char u[200001] = "";
  for (i = 0; i < 200001; i++) {
    strcat(u, v[i]);
    if (s[i] == '\0') {
      break;
    } else if (strcmp(t, u) != 0) {
      d++;
      strcpy(t, u);
      strcpy(u, "");
    }
  }
  printf("%d", d);
}
