#include <bits/stdc++.h>
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1) {
  unsigned day;
  if (dow < dow1) dow += 7;
  day = dow - dow1;
  day += 7 * n - 6;
  return day;
}
unsigned DayToWeekNumber(unsigned day) { return (day - 1) / 7 + 1; }
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0) {
  return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
  string S;
  cin >> S;
  char C;
  bool B = false;
  C = S.at(0);
  int ans = 1;
  for (int i = 1; i < S.size(); i++) {
    if (!B) {
      if (S.at(i) == C) {
        i++;
        ans++;
        B = true;
        continue;
      }
    }
    ans++;
    C = S.at(i);
    B = false;
  }
  cout << ans << endl;
}
