#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int INF = 100000000;
int dfs(string S, string s_pre, string s_post, int i) {
  if (i == S.size()) {
    return 0;
  } else {
    s_post.push_back(S[i]);
    if (s_pre == s_post) {
      return dfs(S, s_pre, s_post, i + 1);
    } else {
      s_pre = s_post;
      s_post = {};
      return dfs(S, s_pre, s_post, i + 1) + 1;
    }
  }
}
int main() {
  string S;
  cin >> S;
  string s_pre, s_post;
  int ans = dfs(S, s_pre, s_post, 0);
  cout << ans << endl;
}
