#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void input() {}
int main() {
  fastio();
  input();
  string s;
  cin >> s;
  int n, i, k = 0;
  n = s.size();
  string temp = "", prev = "";
  for (i = 0; i < n; i++) {
    if (temp + s[i] != prev) {
      prev = temp + s[i];
      k++;
      temp = "";
    } else
      temp += s[i];
  }
  if (temp.size() > 0 && temp != prev) k++;
  cout << k;
  return 0;
}
