#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
  string s;
  cin >> s;
  int ans = 1;
  int i = 0;
  while (i < (int)s.size() - 1) {
    if (s[i] == s[i + 1]) {
      if (i == (int)s.size() - 2) {
        i += 2;
      } else {
        ans += 2;
        i += 3;
      }
    } else {
      ans++;
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
