#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
signed main() {
  string s;
  cin >> s;
  long long n = s.size();
  long long ans = 0;
  for (long long i = 0; i < (n - 1); i++) {
    if (s[i] != s[i + 1]) {
      ans++;
    } else {
      ans++;
      i++;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
