import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    S=input()
    n=len(S)
    ans=0
    now=0
    cnt=2
    while(now<n):
        if(cnt==2):
            ans+=1
            cnt=1
            now+=1
        else:
            if(S[now]!=S[now-1]):
                ans+=1
                now+=1
            else:
                cnt=2
                now+=1
    print(ans+(cnt==2))
resolve()