#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int MN = 20000000;
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  int ans = 0;
  vector<string> st;
  string l = "";
  for (int i = 0; i < n; i++) {
    l += s[i];
    if (st.size() == 0) {
      st.push_back(l);
      l = "";
    } else if (st.back() != l) {
      st.push_back(l);
      l = "";
    }
  }
  cout << st.size();
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
