#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
void solve() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = 0;
  string temp = "";
  for (int i = 0; i < (n); ++i) {
    if (i == n - 2 && s[n - 1] == s[n - 2]) {
      i++;
      ans++;
    } else {
      if (temp != "" + s[i]) {
        temp = "" + s[i];
      } else {
        i++;
        temp = "";
      }
      ans++;
    }
  }
  cout << ans << endl;
}
int main() {
  solve();
  return 0;
}
