#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long ans = 1LL;
  auto tmp1 = string() + s[0];
  for (int i = 1; i < s.size(); i++) {
    auto tmp2 = string() + s[i];
    if (tmp1 == tmp2) {
      i++;
      tmp2 += s[i];
      ans++;
    } else {
      ans++;
    }
    tmp1 = tmp2;
  }
  if (s[s.size() - 1] == s[s.size() - 2]) {
    ans--;
  }
  if (s.size() == 1) {
    ans = 1;
  }
  cout << ans << endl;
}
