#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  string s;
  cin >> s;
  int i = 1;
  int ans = 0;
  while (i < s.size()) {
    if (s[i] == s[i - 1] && i != s.size() - 1) {
      i += 3;
      ans += 2;
    } else {
      i++;
      ans++;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
