#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool comp(const pair<ll, ll> &a, const pair<ll, ll> &b) {
  return a.first < b.first;
}
ll gcd(ll a, ll b) {
  ll tmp, r;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int factorial(int k);
ll nCr(ll n, ll r);
int permutation(int n, int r);
int main() {
  ll a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
  ll x[100004] = {};
  ll y[100004] = {};
  ll x2[100004] = {};
  ll y2[100004] = {};
  ll z[100004] = {{}};
  vector<tuple<ll, ll>> vec;
  string s;
  string t;
  ll m = 0, n = 0;
  cin >> s;
  t = s[0];
  string compare;
  for (int i = 0; i < s.length(); i++) {
    compare = s[i];
    if (t == compare) {
      t = s[i] + s[i + 1];
      i++;
    } else {
      t = s[i];
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
int permutation(int n, int r) {
  int n_sum, r_sum;
  int i;
  r = n - r;
  n_sum = factorial(n);
  r_sum = factorial(r);
  return n_sum / r_sum;
}
ll nCr(ll n, ll r) {
  ll ans = 1;
  for (ll i = n; i > n - r; --i) {
    ans = ans * i;
  }
  for (ll i = 1; i < r + 1; ++i) {
    ans = ans / i;
  }
  return ans;
}
int factorial(int k) {
  int sum = 1;
  for (int i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
