#include <bits/stdc++.h>
using namespace std;
char now;
string s;
int main() {
  int ans, flag;
  cin >> s;
  ans = 1;
  for (int i = 0; i < s.length() - 1;) {
    now = s[i + 1];
    if (s[i] == now)
      i += 2, flag = 1;
    else
      now = s[i], i++, flag = 0;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
