#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
    string s, t1 = "", t2 = "";
    cin >> s;
    t1 += s[0];
    int cnt = 0;
    for (auto c : s) {
        t2 += c;
        if (t1 != t2) {
            ++cnt, t1 = t2, t2 = "";
        }
    }
    printf("%d\n", cnt);
    return 0;
}
