#include <bits/stdc++.h>
using namespace std;
const int INF = (long long int)(1LL << 30) - 1;
const double INFd = 100000000000.0;
const long long int INFl = (long long int)9223372036854775807;
const int MAX = 10000;
const long long int MOD = (long long int)1e9 + 7;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
int dx[4] = {0, -1, 0, 1}, dy[4] = {-1, 0, 1, 0};
int mdx[8] = {0, 1, 0, -1, 1, 1, -1, -1}, mdy[8] = {-1, 0, 1, 0, 1, -1, 1, -1};
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
string s;
int main() {
  int ans = 0;
  int k = 0;
  cin >> s;
  string b = "";
  while (k + 1 < s.size()) {
    if (b.size() == 1 && b[0] != s[k]) {
      b = s[k];
      k++;
    } else {
      b = s[k] + s[k + 1];
      k += 2;
    }
    ans++;
  }
  cout << ans + 1 << endl;
  return 0;
}
