#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};
int main() {
  string s;
  cin >> s;
  ll n = s.size();
  vb v(n + 1, true);
  ll ans = n;
  for (ll i = 1, i_len = (n); i < i_len; ++i) {
    if (v[i - 1] && s[i - 1] == s[i]) {
      ans--;
      v[i + 1] = false;
    }
  }
  cout << ans << endl;
}
