#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size(), c = 1, ans = 1;
  for (int i = 1; i < n; i++) {
    if (s[i - 1] != s[i] || c == 1) {
      ans++;
      c = 0;
    } else {
      c = 1;
    }
  }
  cout << ans;
}
