#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
string s;
bool single = true;
int ans = 0;
int main() {
  cin >> s;
  ans = 1;
  for (int i = 1; i < (s.size()); ++i) {
    if (!single) {
      ans++;
      single = true;
      continue;
    }
    if (s[i] == s[i - 1]) {
      ans++;
      i++;
      single = false;
    } else {
      ans++;
      single = true;
    }
  }
  cout << ans << endl;
  return 0;
}
