#include <bits/stdc++.h>
using namespace std;
string S;
char s[200005];
int solve() {
  if (S.size() == 1) return 1;
  if (S.size() == 2) {
    if (S[0] != S[1])
      return 2;
    else
      return 1;
  }
  string prev = "";
  string curr = "";
  prev += S[0];
  curr += S[1];
  int ans = S.size();
  int i = 2;
  if (S[0] == S[1]) {
    prev = prev + curr;
    curr = S[i++];
    ans--;
  }
  while (1) {
    while (prev == curr && i < S.size()) {
      curr += S[i++];
      ans--;
    }
    if (i >= S.size()) return ans;
    prev = curr;
    curr = S[i++];
  }
}
int main() {
  scanf("%s", s);
  S = s;
  printf("%d\n", solve());
}
