#include <bits/stdc++.h>
using namespace std;
string s;
int len;
string a, b;
int ans;
int main() {
  cin >> s;
  len = s.size();
  int id = 1;
  a = s[0];
  while (id < len) {
    int st = 1;
    b = s.substr(id, st);
    if (b == a) st++;
    b = s.substr(id, st);
    a = b;
    id += st;
    ans++;
  }
  ans++;
  cout << ans;
  return 0;
}
