#include <bits/stdc++.h>
using namespace std;
const long mod = 1000000007;
long gcd(long x, long y) {
  if (x > y) {
    return gcd(y, x);
  }
  long r;
  while (y != 0) {
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}
long lcm(long x, long y) { return (x / gcd(x, y)) * y; }
int main() {
  long res = 0;
  string S;
  cin >> S;
  long slen = S.length();
  string p = "" + S[0];
  res++;
  for (int i = 1; i < slen; i++) {
    string q = "" + S[i];
    while (p == q) {
      i++;
      q += S[i];
      if (i == slen) goto koko;
    }
    p = q;
    res++;
  }
koko:;
  cout << res << endl;
}
