#include <bits/stdc++.h>
const int MOD = 1000000007, INF = 1111111111;
using namespace std;
using lint = long long;
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < (int)vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  }
  return os;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int cnt = 1;
  bool seq = false;
  for (int i = 0; i < (int)s.size() - 1; i++) {
    if (s[i] == s[i + 1] && !seq) {
      i++;
      cnt++;
      seq = true;
    } else {
      cnt++;
      seq = false;
    }
  }
  cout << cnt << "\n";
  return 0;
}
