#include <bits/stdc++.h>
using namespace std;
long long resolve(string &s) {
  long long res = 1;
  for (long long i = 1; i < (long long)s.length();) {
    res++;
    if (s[i - 1] == s[i]) {
      i += 2;
    } else {
      i++;
    }
  }
  return res;
}
int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  long long res1 = resolve(s);
  reverse((s).begin(), (s).end());
  long long res2 = resolve(s);
  cout << max(res1, res2) << endl;
  return 0;
}
