#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
void solve(std::string S) {
  long long cnt = 1, len;
  string lhs, rhs;
  lhs = S[0];
  len = S.length();
  for (long long i = 1; i < len; i++) {
    rhs = S[i];
    if (lhs == rhs) {
      rhs = rhs + S[i + 1];
      i++;
    }
    lhs = rhs;
    cnt++;
  }
  if (S[len - 1] == S[len - 2]) {
    cnt--;
  }
  cout << cnt << endl;
}
int main() {
  std::string S;
  std::cin >> S;
  solve(S);
  return 0;
}
