# coding: utf-8

def Ser():
    S = input()
    for s in S:
        yield s

def main():
    S = []
    Si = ""
    for s in Ser():
        Si += s
        if len(S) == 0 or Si != S[-1]:
            S.append(Si)
            Si = ""
    print(len(S))

main()