

def main():
    s = input()
    ans = 0
    i = 0
    while i < (len(s)-1):
        if s[i] == s[i+1]:
            if i == len(s)-2:
                i += 2
                ans += 1
            else:
                i += 3
                ans += 2
        elif i == len(s)-2:
            i += 2
            ans += 2
        else:
            i += 1
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()