#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  string s;
  long long int ssize = 1, y = 1;
  cin >> s;
  char ss = s[0];
  for (int i = 1; i < s.size();) {
    if (ssize == 1) {
      if (ss == s[i]) {
        ssize = 2;
        i += 2;
      } else {
        ss = s[i];
        i++;
      }
    } else {
      ssize = 1;
      ss = s[i];
      i++;
    }
    y++;
  }
  cout << y << endl;
}
