#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  string S;
  cin >> S;
  set<string> s;
  int n = S.length();
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if(S[i] != S[i - 1]) {
      cnt++;
    } else {
      i++;
      cnt++;
    }
  }
  int dp[n+1][2]{};
  cout << cnt << "\n";
  return 0;
}