#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
const int MOD = 1000000007;
const ll INF = 1LL << 60;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = 1;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] != s[i + 1]) {
      ans++;
    } else {
      i++;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
