#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int nmax = 1e5 + 10;
const int eps = 1e-8;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  int ans = 1, i = 0;
  while (i < n - 1) {
    if (s[i] == s[i + 1])
      i += 2;
    else
      i++;
    ans++;
  }
  cout << ans << "\n";
  return 0;
}
