def main():
    word = input()
    answer = 1
    before = word[0]
    word = word[1:]
    while word != "":
        if word[0] == before and len(word) > 1:
            before = word[1]
            word = word[2:]
        else:
            before = word[0]
            word = word[1:]
        answer += 1
    print(answer)


if __name__ == '__main__':
    main()

