#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int long long MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);
int main() {
  string s;
  cin >> s;
  string pre;
  int cnt = 1;
  bool f = false;
  if (s.size() == 2) {
    if (s[0] != s[1]) {
      cout << 2 << endl;
    } else {
      cout << 1 << endl;
    }
    return 0;
  }
  for (int i = 1; i < s.size(); i++) {
    if (f) {
      if (i == s.size() - 2 && s[i] == s[i + 1]) {
        cnt++;
        break;
      }
      cnt++;
      f = false;
    } else {
      if (s[i] != s[i - 1]) {
        cnt++;
      } else {
        cnt++;
        i++;
        f = true;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
