#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define SORT(i) sort((i).begin(), (i).end())
#define INF 2000000000
constexpr ll mod = 1e9 + 7;
 
int main(){
    string s;
    cin >> s;
    int cnt = 1;
    string a = s[0];
    for (int i = 0; i < s.size();++i){
        if(i == s.size()-1){
            break;
        }
        if(a == s[i+1]){
            ++i;
            if(i == s.size()-2){
                break;
            }
            a = s[i + 1] + s[i + 2];
            ++cnt;
        }
        else {
            a = s[i + 1];
            ++cnt;
        }
    }
    cout << cnt << "\n";

    return 0;
}