#include <bits/stdc++.h>
using namespace std;
string s;
int check(string buf, string &next, int i) {
  if (buf != next) {
    return i;
  }
  i++;
  if (i >= s.size()) {
    next = s.at(i - 1);
    return 0;
  }
  next += s.at(i);
  return check(buf, next, i);
}
int main(void) {
  cin >> s;
  int n = s.size();
  string buf;
  buf = s.at(0);
  int i = 1;
  int cnt = 1;
  while (i < n) {
    string next;
    next = s.at(i);
    int move = check(buf, next, i);
    cnt++;
    if (move == i)
      i++;
    else if (move == 0) {
      break;
    }
    i = move + 1;
    buf = next;
  }
  cout << cnt << endl;
  return 0;
}
