#include <bits/stdc++.h>
using namespace std;
char _;
string second, T, U;
long long i = 0, j = 0, k = 0, a, b, c, d, e, f, g, h, l, m, n, o, p, q, r, s,
          t = 1, u, v, w, x, y, z, maxx = INT_MIN, minn = INT_MAX, ans = 0,
          sum = 0, cnt = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> second;
  i++;
  ans++;
  while (i < second.size()) {
    if (second[i - 1] != second[i]) {
      ans++;
      i++;
    } else {
      i += 2;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
