#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < s.size();) {
    cnt++;
    if (s[i] == s[i - 1])
      i += 2;
    else
      i++;
  }
  cout << cnt << endl;
  return 0;
}
