N = int(eval(input()))

A,B,C = eval(input()),eval(input()),eval(input())

ans = 0

for a,b,c in zip(A,B,C):

    if a != b and b != c and c != a:

        ans += 2

    elif a == b == c:

        ans += 0

    else:

        ans += 1

print(ans)
N = int(eval(input()))

A = eval(input())

B = eval(input())

C = eval(input())

ans = 0

for a,b,c in zip(A,B,C):

    if a==b==c: continue

    if a==b or b==c or c==a:

        ans += 1

    else:

        ans += 2

print(ans)
N = int(eval(input()))
A, B, C = eval(input()), eval(input()), eval(input())
ans = 0
for a, b, c in zip(A, B, C):
    if a != b and b != c and c != a:
        ans += 2
    elif a == b == c:
        ans += 0
    else:
        ans += 1
print(ans)

N = int(eval(input()))
A = eval(input())
B = eval(input())
C = eval(input())
ans = 0
for a, b, c in zip(A, B, C):
    if a == b == c:
        continue
    if a == b or b == c or c == a:
        ans += 1
    else:
        ans += 2
print(ans)

-A, B, C = eval(input()), eval(input()), eval(input()) +A = eval(input()) +B = eval(input()) +C = eval(input()) -    if a != b and b != c and c != a: +    if a == b == c: +        continue +    if a == b or b == c or c == a: +        ans += 1 +    else: -    elif a == b == c: -        ans += 0 -    else: -        ans += 1