#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
template <class T1, class T2>
istream &operator>>(istream &in, pair<T1, T2> &P) {
  in >> P.first >> P.second;
  return in;
}
template <class T1, class T2>
ostream &operator<<(ostream &out, pair<T1, T2> &P) {
  out << "(" << P.first << ", " << P.second << ")";
  return out;
}
template <class T>
istream &operator>>(istream &in, vector<T> &arr) {
  for (auto &x : arr) in >> x;
  return in;
}
template <class T>
ostream &operator<<(ostream &out, vector<T> &arr) {
  for (auto &x : arr) out << x << ' ';
  cout << "\n";
  return out;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  int p = 0;
  cin >> s;
  int n = (int(s.size())), res = 0;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  for (int i = 0; i + 1 < n; i++) {
    if (p == 1 && s[i - 1] == s[i]) {
      p = 2;
      i++;
    } else {
      p = 1;
    }
    res++;
  }
  if (p != 1 || s[n - 2] != s[n - 1]) {
    res++;
  }
  cout << res;
  return 0;
}
