#include <bits/stdc++.h>
using namespace std;
const long long N = 4e5 + 200;
const long long INF = 0x3f3f3f;
const long long Mode = 1e9 + 7;
int main() {
  long long n, m;
  string s;
  cin >> s;
  long long len = s.length();
  long long sum = 0;
  string tmp = "";
  string now = "";
  for (long long i = 1; i < len; i++) {
    now += s[i];
    if (now != tmp) {
      sum++;
      tmp = now;
      now = "";
    }
  }
  cout << sum << endl;
  return 0;
}
