#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
int ans = 0;
vector<string> an;
int main() {
  string s;
  cin >> s;
  string prev = "";
  int i = 0;
  int ans = 0;
  while (i < s.size()) {
    string c;
    c += s[i];
    if (prev == c) {
      i += 1;
      if (i == s.size()) {
        break;
      }
      c += s[i];
    } else {
      prev = c;
      ans += 1;
      i += 1;
    }
  }
  cout << ans + 1 << endl;
}
