s = raw_input()
if len(s)==0:
    print 0
else:
    

    n = len(s)
    K = 0
    s_i1=""
    size=1

    while len(s.strip(s[0])):
        s_i=s[0:size]

        if s_i1 == s_i:
            size = size + 1
        else:
            s_i1=s_i
            s = s[size:]
            size = 1
            K = K + 1

    print K+1

