#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  long long n = s.size();
  long long ans = n;
  vector<string> str(n);
  for (long long i = 0; i < n; i++) {
    str[i] = s[i];
  }
  for (long long i = 0; i < n - 2; i++) {
    if (str[i] == str[i + 1]) {
      str[i + 1] = str[i + 1] + str[i + 2];
      ans--;
    }
  }
  cout << ans << endl;
}
