#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  string s;
  cin >> s;
  int ind = 1;
  long long ans = 0;
  while (ind < s.size()) {
    char tmp = s[ind];
    long long c = 0;
    while (s[ind] == tmp) {
      ind++;
      c++;
    }
    if (c == 0) {
      ind++;
      ans++;
    } else {
      ans += (c + 1) / 2;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
