def A_DividingaString():
    S = input()
    ans = 0
    tmp,last = "", ""
    for s in S:
        tmp += s
        if s != last:
            last = tmp
            tmp = ""
            ans += 1
    print(ans)
    
if __name__ == "__main__":
    A_DividingaString()