#include <bits/stdc++.h>
using namespace std;
int n, x, y, a[200005];
int main() {
  string s;
  cin >> s;
  int ans = 1;
  bool bad = 0;
  for (int i = 1; i < s.size(); ++i) {
    if (s[i] == s[i - 1] and !bad)
      ++i, bad = 1;
    else
      bad = 0;
    if (i == s.size()) break;
    ++ans;
  }
  cout << ans << endl;
}
