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