#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  string prev = "";
  int ans = 0;
  for (int i = 0; i < s.length(); i++) {
    int l = 1;
    string tmp = "" + s[i];
    if (tmp == prev && i == s.length() - 1) break;
    if (tmp == prev) i++, tmp += s[i];
    prev = tmp;
    ans++;
  }
  cout << ans << '\n';
  return 0;
}
