#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long MAX = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int n = s.size(), k = 1;
  for (int i = 1; i < n;) {
    if (s[i] == s[i - 1])
      i += 2;
    else
      i++;
    k++;
  }
  cout << k << "\n";
  return 0;
}
