#include <bits/stdc++.h>
using namespace std;
int vx[] = {0, 0, -1, 1};
int vy[] = {1, -1, 0, 0};
int dx[] = {1, 0, -1, 1, -1, 1, 0, -1};
int dy[] = {1, 1, 1, 0, 0, -1, -1, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
const long long mod = 1e9 + 7;
const int INF = INT_MAX / 2;
const int N_MAX = 100010;
int main() {
  string str;
  cin >> str;
  int cnt = 0;
  int cur = 0;
  for (int i = 0; i < int(str.size() - 1); i++) {
    if (str[i] != str[i + 1]) {
      cnt++;
    } else {
      cnt++;
      i++;
    }
  }
  cnt++;
  cout << cnt << endl;
  return 0;
}
