"""

aabbaa



aa b ba a

a ab b aa

"""

s = list(eval(input()))



n = len(s)

hst = []

sk = ""



for i in range(n):

    sk += s[i]

    if i == 0:

        hst.append(sk)

        sk = ""

    elif hst[-1] != sk:

        hst.append(sk)

        sk = ""



print((len(hst)))
s = list(eval(input()))



n = len(s)

hst = ["#"]

sk = ""



for i in range(n):

    sk += s[i]

    if hst[-1] != sk:

        hst.append(sk)

        sk = ""



print((len(hst)-1))
"""
aabbaa
aa b ba a
a ab b aa
"""
s = list(eval(input()))
n = len(s)
hst = []
sk = ""
for i in range(n):
    sk += s[i]
    if i == 0:
        hst.append(sk)
        sk = ""
    elif hst[-1] != sk:
        hst.append(sk)
        sk = ""
print((len(hst)))

s = list(eval(input()))
n = len(s)
hst = ["#"]
sk = ""
for i in range(n):
    sk += s[i]
    if hst[-1] != sk:
        hst.append(sk)
        sk = ""
print((len(hst) - 1))

-""" -aabbaa -aa b ba a -a ab b aa -""" -hst = [] +hst = ["#"] -    if i == 0: +    if hst[-1] != sk: -    elif hst[-1] != sk: -        hst.append(sk) -        sk = "" -print((len(hst))) +print((len(hst) - 1))