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