#include <bits/stdc++.h>
using namespace std;
template <typename tp>
inline void read(tp& x) {
  x = 0;
  register int f = 1;
  register char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  x *= f;
}
template <typename Tp>
inline void print(Tp x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 1e6 + 10;
char s[maxn];
int ans;
char last;
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  int temp = 1;
  ans = 1;
  for (register int i = 2; i <= len; ++i) {
    if (s[i] != s[i - 1]) {
      ans++;
      last = s[i];
    }
    if (s[i] == s[i - 1]) {
      ans++;
      i++;
    }
  }
  print(ans);
  return 0;
}
