#A問題
S = list(str(input()))
Slen = len(S)
now = ""
count = 0

dp = [0 for i in range(Slen)]
nflag = 0
for i in range(Slen):
    if i == 0:
        now = S[0]
        dp[0] = 1
    else:
        if len(now) == 1:
            if now == S[i]:
                dp[i] = dp[i-1]
                if nflag == 1:
                    now += S[i]
                else:
                    nflag = 1
                    dp[i]+=1
            else:
                dp[i] = dp[i-1]+1
                now = S[i]
                
        else:
            dp[i] = dp[i-1]+1
            now = S[i]
            
print(dp[Slen-1])