#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int i = 0, n = s.length();
  string h[n];
  h[0] = "";
  h[0] += s[0];
  for (i = 1; i < n; i++) {
    string c = "";
    c += s[i];
    if ((c.compare(h[0])) == 0)
      h[0] += s[i];
    else {
      break;
    }
  }
  long long int count = 1, k = 1;
  for (int j = i; j < s.length(); j++) {
    h[k] += s[j];
    if (h[k - 1].length() == h[k].length() &&
        h[k - 1][h[k - 1].length() - 1] == h[k][h[k].length() - 1])
      continue;
    else {
      k++;
      h[k] = "";
    }
  }
  cout << k << endl;
}
