s_list = list(input())

length = len(s_list)

def func(idx,past):
    if idx==length:
        return 0
    if idx>length:
        return -1
    
    if s_list[idx] == past:
        return func(idx+2,s_list[idx:idx+2]) + 1
    else:
        return func(idx+1,s_list[idx])+1

print(func(0,""))