#include <bits/stdc++.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fill(x,y) memset(x,y,sizeof(x))
#define INF 999999999
#define MOD 1000000007
#define IOS cin.tie(0); ios::sync_with_stdio(false)
#define VV vector<vector<int>>
#define PQ priority_queue<int>
#define PQG priority_queue<int,vector<int>,greater<int>>
using namespace std;

int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int gcd(int a,int b){return b ? gcd(b,a%b) : a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}

main() {
    string S; cin >> S;
    string s; string t; int cnt=0;
    bool can = false;
    rep(i,S.size()){
        if(can){t.erase(all(t));}
        if(i==0) {s=S[0]; cnt++;}
        else {
            t+=S[i];
            if(s==t) {continue;}
            else {
                s=t;
                cnt++;
                can = true;
            }
        }
    }
    cout << cnt << endl;

    return 0;
}