#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
int main() {
  string s;
  cin >> s;
  int ans = 1;
  for (int i = 1; i < s.length(); i++) {
    if (s[i] == s[i - 1] && i == s.length() - 1) {
      continue;
    }
    if (s[i] == s[i - 1] && i == s.length() - 2) {
      ans++;
      continue;
    }
    if (s[i] == s[i - 1] && i != s.length() - 1) {
      i += 2;
      ans += 2;
      continue;
    }
    ans++;
  }
  cout << ans << endl;
}
