#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  string s;
  cin >> s;
  string a = "" + s[0], b = "";
  int ans = 0;
  for (int i = 1; i < s.size(); i++) {
    b += s[i];
    if (a != b) {
      ans++;
      a = b;
      b = "";
    }
  }
  cout << ans << endl;
  return 0;
}
