#include <iostream>
using namespace std;

int main() {
    string s;
    cin >> s;
    int result = 0;
    string last, current;
    for (int i = 0; i <= s.size(); i++) {
        if (!current.empty() && current != prev) {
            result++;
            prev = current;
            current.clear();
        }
        current.push_back(s[i]);
    }
    cout << result;
    return 0;
}