s = list(eval(input()))

c = 0

x = s[::-1]

for i in range(len(s)):

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

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

        c += 1

print(c)
s = list(eval(input()))

c = 0

x = s[::-1]

for i in range(len(s)):

    if s[i] != x[i]:

        x[i] = s[i]

        c += 1

        s[::-1] = x

print(c)
s = list(eval(input()))
c = 0
x = s[::-1]
for i in range(len(s)):
    if s[i] != s[::-1][i]:
        s[i] = s[::-1][i]
        c += 1
print(c)

s = list(eval(input()))
c = 0
x = s[::-1]
for i in range(len(s)):
    if s[i] != x[i]:
        x[i] = s[i]
        c += 1
        s[::-1] = x
print(c)

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