import sys
sys.setrecursionlimit(10**6)

s=list(input())
#print(s[0])

if(len(s)==1):
    print(1)
    exit()

t=s[0]
s.pop(0)
#print(s)

count=1
while(s!=[]):
    if s[0]==t and len(s)!=1:
        t=s[0]+s[1]
#        print(t)
        s.pop(0)
        s.pop(0)
#        print(s)
        count+=1
    elif s[0]==t and len(s)==1:
#        t=s[0]
        s.pop(0)
#        print(s)
#        count+=1
    else:
        t=s[0]
        s.pop(0)
#        print(s)
        count+=1
print(count)

