#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  int n = s.size();
  for (int i = 0; i < (int)(n - 1); i++) {
    if (s[i] != s[i + 1]) {
      ans++;
      if (i == n - 2) ans++;
    } else {
      ans += 2;
      if (i == n - 2) ans--;
      i += 2;
    }
  }
  cout << ans << endl;
}
