#include <bits/stdc++.h>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::string s;
  cin >> s;
  int result = 0;
  int itr = 0;
  while (true) {
    if (itr + 1 >= s.size()) break;
    if (s[itr] != s[itr + 1]) {
      itr += 2;
      result += 2;
    } else {
      itr += 3;
      result += 2;
    }
  }
  cout << result << endl;
  return 0;
}
