s = eval(input())

if len(s) % 2 == 0:

    s_1 = s[:len(s) // 2]

    s_2 = s[len(s) // 2:][::-1]

else:

    s_1 = s[:len(s) // 2 + 1]

    s_2 = s[len(s) // 2:][::-1]

ans = 0

for i in range(len(s_1)):

    if s_1[i] != s_2[i]:

        ans += 1

print(ans)
s = eval(input())

ans = 0

for i in range(len(s) // 2):

    if s[i] != s[-i - 1]:

        ans += 1

print(ans)
s = eval(input())
if len(s) % 2 == 0:
    s_1 = s[: len(s) // 2]
    s_2 = s[len(s) // 2 :][::-1]
else:
    s_1 = s[: len(s) // 2 + 1]
    s_2 = s[len(s) // 2 :][::-1]
ans = 0
for i in range(len(s_1)):
    if s_1[i] != s_2[i]:
        ans += 1
print(ans)

s = eval(input())
ans = 0
for i in range(len(s) // 2):
    if s[i] != s[-i - 1]:
        ans += 1
print(ans)

-if len(s) % 2 == 0: -    s_1 = s[: len(s) // 2] -    s_2 = s[len(s) // 2 :][::-1] -else: -    s_1 = s[: len(s) // 2 + 1] -    s_2 = s[len(s) // 2 :][::-1] -for i in range(len(s_1)): -    if s_1[i] != s_2[i]: +for i in range(len(s) // 2): +    if s[i] != s[-i - 1]: