#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1LL << 60;
const int INF = 1001001001;
const int MOD = 1000000007;
int main() {
  string s;
  cin >> s;
  int l = s.size();
  vector<string> dp(l);
  dp[0] = s[0];
  int k = l;
  for (int i = 1; i <= (l - 1); i++) {
    string a(s[i], 2);
    if (dp[i - 1] == a) {
      dp[i - 1] += a;
      k--;
    } else {
      dp[i] = a;
    }
  }
  cout << k << endl;
  return 0;
}
