n=int(eval(input()))

ans=0

for a,b,c in zip(eval(input()),eval(input()),eval(input())):ans+=len(set([a,b,c]))-1

print(ans)
I=input;I();print((sum(len(set(s))-1for s in zip(I(),I(),I()))))
n = int(eval(input()))
ans = 0
for a, b, c in zip(eval(input()), eval(input()), eval(input())):
    ans += len(set([a, b, c])) - 1
print(ans)

I = input
I()
print((sum(len(set(s)) - 1 for s in zip(I(), I(), I()))))

-n = int(eval(input())) -ans = 0 -for a, b, c in zip(eval(input()), eval(input()), eval(input())): -    ans += len(set([a, b, c])) - 1 -print(ans) +I = input +I() +print((sum(len(set(s)) - 1 for s in zip(I(), I(), I()))))