#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int BinarySearch(int key, int n, int S[]) {
  int l = 0, r = n;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (S[mid] > key)
      r = mid;
    else
      l = mid;
  }
  return S[l] == key ? 1 : 0;
}
int main() {
  char S[200007];
  int cnt = 0;
  cin >> S;
  int i = 0;
  while (i < strlen(S)) {
    if (i == 0) {
      i++;
      cnt++;
      continue;
    }
    if (S[i] == S[i - 1]) {
      cnt++;
      i += 2;
    } else {
      cnt++;
      i++;
    }
  }
  cout << cnt << endl;
}
