#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
const ll mod = 1000000007;
const ll INF = 1000000099;
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
signed main() {
  string s;
  cin >> s;
  int k = 1;
  string mae = "", now = "";
  mae += s[0];
  for (int i = 1; i < (ll)(s).size(); i++) {
    now += s[i];
    if (now != mae) {
      k++;
      mae = now;
      now = "";
    } else {
      mae += now;
    }
  }
  cout << k << endl;
}
