#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  char p = '.';
  ll r = 0;
  for (ll i = 0; i < s.size(); i++) {
    if (s[i] == p)
      p = '.', i++;
    else
      p = s[i];
    r++;
  }
  if (p != '.') r--;
  cout << r << endl;
}
