#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1 << 29);
int main() {
  string S;
  cin >> S;
  int ans = 1;
  int f, e;
  for (int i = 1; i < S.size(); i++) {
    if (S[i] == S[i - 1]) {
      i++;
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
