import sys
def main():
    input = sys.stdin.readline
    s = input()

    cnt = 0
    restore = []
    i = 0
    while i < len(list(s)):
        #print("==")
        #print(i)
        #print(cnt)
        #print(restore)
        if i == 0:
            restore.append(s[i])
            cnt += 1
            i += 1
        else:
            j = 0
            while j < len(list(s)) - i:
                if  j == 0:
                    string = s[i]
                else:
                    string = s[i:i+j+1]
                #print(string)
                if restore[-1] == string:
                    j += 1
                else:
                    cnt += 1
                    restore.append(string)
                    #print(j)
                    break
            i += j + 1

    print(cnt)
 
if __name__ == '__main__':
    main()