#include <bits/stdc++.h>
using namespace std;
int keta(long long x) {
  if (x < 10) {
    return 1;
  } else {
    return keta(x / 10) + 1;
  }
}
int keta_wa(long long x) {
  if (x < 10) {
    return x;
  } else {
    return keta_wa(x / 10) + x % 10;
  }
}
int ctoi(char c) { return ((c >= '0' && c <= '9') ? c - '0' : 0); }
long long sum(long long a[], long long N) { return accumulate(a, a + N, 0LL); }
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
long long lcm(long long a, long long b) {
  if (a < b) {
    swap(a, b);
  }
  return a / gcd(a, b) * b;
}
int solve() {
  string s;
  cin >> s;
  int N = s.size();
  if (N == 1) {
    return 1;
  }
  int dp[N];
  dp[0] = 1;
  if (dp[0] != dp[1]) {
    dp[1] = 2;
  } else {
    dp[1] = 1;
  }
  for (int i = 2; i < N; i++) {
    if (s[i - 1] != s[i]) {
      dp[i] = dp[i - 1] + 1;
    } else {
      dp[i] = dp[i - 2] + 1;
    }
  }
  return dp[N - 1];
}
int main() { cout << solve() << "\n"; }
