#include <bits/stdc++.h>
using namespace std;
long long gd(long long num) {
  long long digit = 0;
  while (num != 0) {
    num /= 10;
    digit++;
  }
  return digit;
}
long long lcm(long long a, long long b) {
  long long r, x, tmp;
  x = a * b;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return x / b;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  } else if (b == 0) {
    return a;
  } else {
    long long tmp, r;
    if (a < b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    r = a % b;
    while (r != 0) {
      a = b;
      b = r;
      r = a % b;
    }
    return b;
  }
}
int main(void) {
  const long long M = 1000000007;
  string s;
  long long b, c, n;
  long long ans = 0;
  long long cnt = 1;
  cin >> s;
  n = s.length();
  long long a[n];
  for (long long i = 0; i < (n); ++i) a[i] = s.at(i) - 'a';
  for (long long i = 0; i < (n); ++i) {
    if (cnt == 1 && i != 0) {
      if (a[i - 1] == a[i]) {
        cnt = 2;
        i++;
      }
      ans++;
    } else if (cnt == 2 && i != 0) {
      ans++;
      cnt = 1;
    }
  }
  long long ans2 = ans;
  ans = 0;
  cnt = 2;
  for (long long i = 0; i < (n); ++i) {
    if (cnt == 1 && i != 0) {
      if (a[i - 1] == a[i]) {
        cnt = 2;
        i++;
      }
      ans++;
    } else if (cnt == 2 && i != 0) {
      ans++;
      cnt = 1;
    }
  }
  cout << max(ans, ans2) << endl;
  return 0;
}
