# A - Dividing a String

def count_substrings(first_substring):



	arr = [first_substring]

	i = len(first_substring)



	while i < len(S):

		s = S[i]

	

		if s == arr[-1]:

			if i + 1 < len(S):

				i += 1

				s += S[i]

			else:

				arr[-1] += s

				break

	

		arr.append(s)

		i += 1



	return len(arr)





S = eval(input())



ans1 = count_substrings(S[:1])

ans2 = count_substrings(S[:2])



print((max(ans1, ans2)))
# A - Dividing a String

S = eval(input())



arr = [S[0]]

i = 1



while i < len(S):

	s = S[i]

	

	if s == arr[-1]:

		if i + 1 < len(S):

			i += 1

			s += S[i]

		else:

			arr[-1] += s

			break

	

	arr.append(s)

	i += 1



print((len(arr)))
# A - Dividing a String
def count_substrings(first_substring):
    arr = [first_substring]
    i = len(first_substring)
    while i < len(S):
        s = S[i]
        if s == arr[-1]:
            if i + 1 < len(S):
                i += 1
                s += S[i]
            else:
                arr[-1] += s
                break
        arr.append(s)
        i += 1
    return len(arr)


S = eval(input())
ans1 = count_substrings(S[:1])
ans2 = count_substrings(S[:2])
print((max(ans1, ans2)))

# A - Dividing a String
S = eval(input())
arr = [S[0]]
i = 1
while i < len(S):
    s = S[i]
    if s == arr[-1]:
        if i + 1 < len(S):
            i += 1
            s += S[i]
        else:
            arr[-1] += s
            break
    arr.append(s)
    i += 1
print((len(arr)))

-def count_substrings(first_substring): -    arr = [first_substring] -    i = len(first_substring) -    while i < len(S): -        s = S[i] -        if s == arr[-1]: -            if i + 1 < len(S): -                i += 1 -                s += S[i] -            else: -                arr[-1] += s -                break -        arr.append(s) -        i += 1 -    return len(arr) - - -ans1 = count_substrings(S[:1]) -ans2 = count_substrings(S[:2]) -print((max(ans1, ans2))) +arr = [S[0]] +i = 1 +while i < len(S): +    s = S[i] +    if s == arr[-1]: +        if i + 1 < len(S): +            i += 1 +            s += S[i] +        else: +            arr[-1] += s +            break +    arr.append(s) +    i += 1 +print((len(arr)))