#include <bits/stdc++.h>
using namespace std;
using vi = vector<long long>;
using pint = pair<long long, long long>;
struct io {
  io() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.tie(0);
    cout << fixed << setprecision(20);
  }
} io;
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &e : v) is >> e;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, vector<T> v) {
  os << "{";
  for (T &e : v)
    os << e << (v.size() - (long long)(&e - &v[0]) > 1 ? ", " : "");
  os << "}";
  return os;
}
void _DEBUG() {}
template <typename H, typename... T>
void _DEBUG(H a, T... b) {
  cerr << a << (sizeof...(b) ? "," : "\n");
  _DEBUG(b...);
}
inline void in() {}
template <typename H, typename... T>
void in(H &a, T &...b) {
  cin >> a;
  in(b...);
}
inline void out() {}
template <typename H, typename... T>
void out(H a, T... b) {
  cout << a << (sizeof...(b) ? " " : "\n");
  out(b...);
}
template <class T>
void resz(long long n, T &v) {
  v.resize(n);
}
template <class H, class... T>
void resz(long long n, H &a, T &...b) {
  a.resize(n);
  resz(n, b...);
}
template <typename V, typename H>
void resize(vector<V> &v, const H a) {
  v.resize(a);
}
template <typename V, typename H, typename... T>
void resize(vector<V> &v, const H &a, const T... b) {
  v.resize(a);
  for (auto &v : v) resize(v, b...);
}
const long long INF = 1LL << 55;
const long long MOD = 1000000007;
const double EPS = 1e-8;
string S;
long long ans = 1;
signed main() {
  in(S);
  string preview = S.substr(0, 1);
  long long i = 0;
  for (; i < S.size(); i++) {
    string current = S.substr(i, 1);
    true;
    if (preview == current) {
      current = S.substr(i, 2);
      i++;
    }
    preview = current;
    ans++;
  }
  if (i >= S.size()) ans--;
  out(ans);
  return 0;
}
