#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  string s;
  cin >> s;
  int ret = 0;
  int pivot = 0;
  int len = 1;
  while (pivot < s.size()) {
    if (pivot + len == s.size()) break;
    bool divided = false;
    for (int i = 0; i < len; ++i) {
      if (pivot + i + len >= s.size()) {
        ++ret;
        pivot += len;
        divided = true;
        len = 1;
        break;
      }
      if (s[pivot + i] == s[pivot + i + len]) {
      } else {
        ret += 2;
        pivot += len + i + 1;
        divided = true;
        len = 1;
        break;
      }
    }
    if (!divided) ++len;
  }
  cout << ret << endl;
  return 0;
}
