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