#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int i = 1, c = 1;
  while (s[i] != '\0') {
    if (s[i] != s[i - 1]) {
      i++;
      c++;
    } else if (s[i] == s[i - 1]) {
      c++;
      i += 2;
    }
  }
  cout << c << endl;
  return 0;
}
