#include <bits/stdc++.h>
using namespace std;
int len, ans;
bool vis[200003];
char s[200003];
inline int read() {
  int X = 0, w = 0;
  char ch = 0;
  while (ch < '0' || ch > '9') w |= ch == '-', ch = getchar();
  while (ch >= '0' && ch <= '9')
    X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  ans = 1;
  for (int i = 2; i <= len; i++) {
    if (vis[i - 1])
      ans++;
    else {
      if (s[i - 1] == s[i])
        vis[i + 1] = 1;
      else
        ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
