#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using pl = pair<ll, ll>;
using vvb = vector<vector<bool>>;
using vb = vector<bool>;
ll f(ll a, ll b, ll p) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    ll t = f(a, b / 2, p);
    return t * t % p;
  }
  return a * (f(a, b - 1, p)) % p;
}
signed main() {
  string s;
  cin >> s;
  int n = s.size();
  string memo;
  ll ans = 0;
  ll ind = n - 1;
  while (ind >= 0) {
    string t;
    t.push_back(s[ind]);
    ind--;
    if (memo != t) {
      memo = t;
      ans++;
      continue;
    }
    ind--;
    if (ind < 0) break;
    t.push_back(s[ind]);
    ans++;
    memo = t;
  }
  cout << ans << endl;
  return 0;
}
