import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

def main():
    S = input()
    N = len(S)
    num = 1
    i = 1
    flag = True # 前回が1文字
    while(i < N):
        if S[i-1] == S[i] and flag:
            i += 2
            flag = False
        else:
            i += 1
            flag = True
        num += 1
    if not flag:
        num -= 1
    
    print(num)
            


if __name__ == '__main__':
    main()