#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  if (s.size() == 1)
    cout << 1 << endl;
  else {
    long long count = 0;
    bool f = 1, k = 0;
    for (int i = (0); i < (s.size() - 1); i++) {
      if (f) {
        count++;
        if (s[i] == s[i + 1]) f = 0;
      } else {
        count++;
        f = 1;
        i++;
      }
      if (i == s.size() - 1) k = 1;
    }
    if (s[s.size() - 1] != s[s.size() - 2] || k == 0) count++;
    cout << count << endl;
  }
}
