#include <bits/stdc++.h>
using namespace std;
string s;
void Process() {
  int i = 0, cou = 0, state = 0;
  while (i <= s.length() - 1) {
    if (s[i] == s[i + 1]) {
      if (state == 0) {
        i += 2;
        state = 1;
      } else {
        state = 0;
        i++;
      }
    } else {
      i++;
      state = 0;
    }
    cou++;
  }
  cout << cou;
}
void Input() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  freopen("abc.txt", "r", stdin);
  cin >> s;
}
int main() {
  Input();
  Process();
  return 0;
}
