#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
void solve() {
  string s;
  cin >> s;
  int sum = 1;
  string temp;
  string tempp;
  temp.push_back(s[0]);
  for (int i = 1; i < s.size(); i++) {
    tempp = "";
    tempp.push_back(s[i]);
    if (tempp + tempp == temp) {
      temp = tempp;
      temp = "";
      sum++;
    } else if (temp == tempp)
      temp.push_back(s[i]);
    else {
      sum++;
      temp = tempp;
    }
  }
  if (temp != tempp) sum++;
  cout << sum << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
