#include <bits/stdc++.h>
using namespace std;
vector<int> dp;
int main(int argc, char const *argv[]) {
  string str, prev = "";
  cin >> str;
  dp.assign(str.size(), -1);
  map<int, string> mmap;
  mmap[0] = str[0];
  dp[0] = 1;
  string tmp = "";
  for (int i = 1; i < str.size(); ++i) {
    if (i - 1 >= 0) {
      tmp = "";
      tmp += str[i];
      if (tmp != mmap[i - 1]) {
        if (dp[i] <= dp[i - 1] + 1) {
          dp[i] = dp[i - 1] + 1;
          mmap[i] = tmp;
        }
      }
    }
    if (i - 2 >= 0) {
      tmp = "";
      tmp += str[i] + str[i - 1];
      if (tmp != mmap[i - 2]) {
        if (dp[i] <= dp[i - 2] + 1) {
          dp[i] = dp[i - 2] + 1;
          mmap[i] = tmp;
        }
      }
    }
  }
  cout << dp[str.size() - 1] << "\n";
  return 0;
}
