#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dy[] = {0, 1, 0, -1};
int dx[] = {1, 0, -1, 0};
int main() {
  string s;
  cin >> s;
  long long res = 1;
  if (s.size() == 1) {
    cout << 1 << endl;
    return 0;
  }
  char c = '0';
  for (long long i = (0); i < (s.size()); i++) {
    if (c == s[i]) {
      res++;
      c = s[i];
      i += 2;
    } else {
      res++;
      c = s[i];
    }
  }
  cout << res << endl;
}
