S = input()

dp=[0]*len(S)
dp[0]=1
dp[1]=int(S[0]!=S[1])+dp[0]
dp[2]=dp[0]+int(S[2]!=S[1])

for i in range(3,len(S)):
        if S[i] != S[i-1]:
                dp[i]=dp[i-1]+1
        else:
                dp[i]=dp[i-3]+2
                #print("not",i,i-1)

print(dp[len(S)-1])