#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int MAXN = 2e5 + 5;
char s[MAXN];
int dp[MAXN][10];
int n;
int main(int argc, char const *argv[]) {
  scanf("%s", s);
  n = strlen(s);
  int ans = 0;
  pair<int, int> la = make_pair(1, 1);
  for (int i = 1; i < n; ++i) {
    if (s[i] == s[i - 1] && la.first == la.second && la.first == i - 1) {
      ++i;
      la = make_pair(i - 1, i);
    } else {
      la = make_pair(i, i);
    }
    ++ans;
  }
  printf("%d\n", ans);
  return 0;
}
