#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  string tmp1, tmp2;
  tmp1 += s[0];
  int cnt1 = 1, cnt2 = 1;
  for (int i = 1; i < s.size(); i++) {
    tmp2 += s[i];
    if (tmp2 != tmp1) {
      cnt1++;
      tmp1 = tmp2;
      tmp2.clear();
    }
  }
  if (tmp1 == tmp2) cnt1--;
  tmp1.clear();
  tmp2.clear();
  tmp1 += s[0];
  tmp1 += s[1];
  for (int i = 2; i < s.size(); i++) {
    tmp2 += s[i];
    if (tmp2 != tmp1) {
      cnt2++;
      tmp1 = tmp2;
      tmp2.clear();
    }
  }
  if (tmp1 == tmp2) cnt2--;
  cout << max(cnt1, cnt2);
}
