#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long INFL = 0x3f3f3f3f3f3f3f3f;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) {
  long long g = gcd(x, y);
  return x / g * y;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int sum = 1, n = s.size();
  for (int i = 0; i < n - 1;) {
    if (s[i] != s[i + 1]) {
      sum++;
      i++;
    } else {
      sum++;
      i += 2;
    }
  }
  cout << sum << endl;
}
