#include <bits/stdc++.h>
using namespace std;
vector<string> v;
int main() {
  int t, tc = 0;
  string s;
  cin >> s;
  string a, b;
  int cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    a.push_back(s[i]);
    if (v.size() == 0 || a != v[v.size() - 1]) v.push_back(a);
    for (int j = i + 1; j < s.size(); j++) {
      b.push_back(s[j]);
      if (b != v[v.size() - 1]) {
        i = j;
        cnt++;
        v.push_back(b);
        break;
      }
    }
    cnt++;
    a.clear();
    b.clear();
  }
  cout << v.size() << endl;
  return 0;
}
