#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001000;
const long long INF = 1LL << 60;
const int MOD = (int)1e9 + 7;
int main() {
  string s;
  cin >> s;
  int ans = 1;
  vector<bool> can(s.size() + 10, true);
  for (int i = 1; i < s.size(); ++i) {
    if (!can[i]) continue;
    if (s[i] == s[i - 1]) can[i + 1] = false;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
