#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const int N = 2e5 + 15;
int n, m, k, q, a[N];
string s, t, last;
bool flag;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; ++i) {
    if (t + s[i] != last) {
      ++k;
      last = t + s[i];
      t = "";
    }
  }
  cout << k + 1 << '\n';
  return 0;
}
