#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 1e5 + 5;
string s;
vector<string> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  string tmp = "";
  tmp += s[0];
  char c = '?';
  for (int i = 1; i < s.size(); i++) {
    if (c != s[i] && tmp.size() == 1 && s[i] == s[i - 1])
      tmp += s[i], c = s[i];
    else if (tmp == "" || tmp == v.back())
      tmp += s[i], c = '?';
    if (v.empty() || tmp != v.back()) {
      v.push_back(tmp);
      tmp = "";
    }
  }
  cout << v.size();
  return 0;
}
