#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int inf = 1000000000;
long long INF = 10000000000000000;
int main() {
  string s;
  cin >> s;
  int ans = s.size(), t = 0;
  for (int(i) = 0; (i) < (s.size() - 1); (i)++) {
    if (i == 0) {
      continue;
    }
    if (s.at(i - 1) == s.at(i)) {
      i++;
      ans--;
    }
  }
  cout << ans << endl;
}
