#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug &operator<<(const c &) {
    return *this;
  }
};
int cnt = 0;
void solve() {
  string s;
  cin >> s;
  long long res = 0;
  for (int i = 0; i < s.length() - 1; ++i) {
    if (s[i + 1] == s[i] && i != 0) {
      res++;
      i++;
    } else if (s[i + 1] == s[i] && i == 0) {
      res++;
      i += 2;
    }
  }
  cout << s.length() - res << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
