#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod = 1e9;
int main() {
  string s;
  cin >> s;
  int cnt(1);
  string a{s[0]};
  for (int i(1); i < s.size(); i++) {
    if (i == s.size() - 1 && s[i] == s[i - 1]) break;
    string si{s[i]};
    if (si == a) {
      a = s[i] + s[i + 1];
      i++;
      cnt++;
    } else {
      cnt++;
      a = s[i];
    }
  }
  cout << cnt << endl;
  return 0;
}
