#include <bits/stdc++.h>
using namespace std;
string s;
void input() { cin >> s; }
bool judge(int i) { return s[i] == s[i - 1]; }
int main() {
  input();
  int n = (int)s.length();
  int ans = 1;
  int sum = 0;
  int buf = 0;
  int i = 1;
  while (i < n) {
    int tmp = i;
    if (judge(i) && buf == 0) {
      i++;
      ans++;
      buf = 1;
    } else {
      ans++;
      buf = 0;
    }
    if (tmp == n - 1) {
      if (judge(tmp) && buf == 0) ans--;
    }
    i++;
  }
  cout << ans << endl;
  return 0;
}
