#include <bits/stdc++.h>
using namespace std;
const int inf = 2147483647, dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
const int N = 100005, M = 1000005, K = 200005, mod = 1000000007;
const long long llinf = 9223372036854775807ll;
string s;
int ans;
bool f;
int main() {
  cin >> s;
  f = false;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != s[i - 1] || i == 0 || f)
      ans++, f = false;
    else
      ans++, i++, f = true;
  }
  cout << ans;
  return 0;
}
