#include <bits/stdc++.h>
using namespace std;
using Board = vector<vector<char>>;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  S = S + "0";
  char memo = '0';
  int ans = 0;
  int count = 0;
  while (count <= N - 1) {
    if (memo != S[count]) {
      memo = S[count];
      count++;
    } else {
      memo = S[count + 1];
      count += 2;
    }
    ans++;
  }
  cout << ans << endl;
}
