#include <bits/stdc++.h>
const long long maxn = 10003;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1);
using namespace std;
long long kc(long long a, long long b) {
  long long c = 1;
  while (b) {
    if (b & 1) c = (c * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return c;
}
int kc(int a, long long b, int mod1) {
  int c = 1;
  while (b) {
    if (b & 1) c = (long long)c * a % mod1;
    a = (long long)a * a % mod1;
    b >>= 1;
  }
  return c;
}
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  char ch = nc();
  long long sum = 0;
  while (!(ch >= '0' && ch <= '9')) ch = nc();
  while (ch >= '0' && ch <= '9') sum = sum * 10 + ch - 48, ch = nc();
  return sum;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
bool cmp(long long a, long long b) { return a > b; }
struct A {
  int x, y;
  bool operator<(A z) { return y < z.y; }
} s[maxn];
int dp[2][1000003];
long long f[1000003];
int sum[103];
int main() {
  string s;
  cin >> s;
  int a = s.size();
  int sum = 1;
  int x = 0;
  for (int i = 1; i < a; i++)
    if (s[i] == s[i - 1] && !x) {
      sum++;
      i++;
      x = 1;
    } else {
      sum++;
      x = 0;
    }
  cout << sum << endl;
}
