#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  bool f = 0;
  char c = getchar();
  while (c < '0' || c > '9') f |= c == '-', c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar();
  return f ? -x : x;
}
char str[200000 + 5];
int main() {
  scanf("%s", str + 1);
  int Ans = 0, N = strlen(str + 1);
  for (int i = 1; i <= N; i++) {
    if (str[i] == str[i - 1]) str[++i] = '$';
    Ans++;
  }
  printf("%d", Ans);
}
