#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n;
char a[maxn];
int main() {
  scanf("%s", a + 1);
  n = strlen(a + 1);
  int ans = 0;
  char c1 = 0, c2 = 0;
  for (int i = (1), iend = (n); i <= iend; ++i) {
    if (c2) {
      c1 = a[i], c2 = 0, ans++;
    } else {
      if (c1 == a[i]) {
        c1 = a[i], c2 = a[++i], ans++;
      } else {
        if (i == n - 1 && a[i] == a[n]) {
          ans++;
          break;
        }
        c1 = a[i], ans++;
      }
    }
  }
  printf("%d", ans);
  return 0;
}
