#include <bits/stdc++.h>
template <typename QvQ>
inline QvQ Min(QvQ a, QvQ b) {
  if (a < b) return a;
  return b;
}
template <typename QvQ>
inline QvQ Max(QvQ a, QvQ b) {
  if (a > b) return a;
  return b;
}
template <typename QvQ>
inline void read(QvQ &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; c = getchar())
    x = (x << 1) + (x << 3) + (c ^ 48);
  x = x * f;
}
template <typename QvQ>
inline void write(QvQ x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + 48);
}
using namespace std;
int n;
char a[200005];
string dq;
int main() {
  scanf("%s", a + 1);
  n = strlen(a + 1);
  int ans = 1;
  for (register int i = 2; i <= n; ++i) {
    if (a[i] != a[i - 1])
      ++ans;
    else
      ++ans, ++i;
  }
  write(ans);
  return 0;
}
