Problem:
 Score : 200 points    Problem Statement You are given three strings A, B and C . Each of these is a string of length N consisting of lowercase English letters.  Our objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:   Operation: Choose one of the strings A, B and C , and specify an integer i between 1 and N (inclusive). Change the i -th character from the beginning of the chosen string to some other lowercase English letter.   What is the minimum number of operations required to achieve the objective?      Constraints  1 \leq N \leq 100  Each of the strings A, B and C is a string of length N .  Each character in each of the strings A, B and C is a lowercase English letter.         Input Input is given from Standard Input in the following format:  N  A  B  C       Output Print the minimum number of operations required.        Sample Input 1 4
west
east
wait      Sample Output 1 3  In this sample, initially A =  west 、 B =  east 、 C =  wait . We can achieve the objective in the minimum number of operations by performing three operations as follows:   Change the second character in A to a . A is now wast .  Change the first character in B to w . B is now wast .  Change the third character in C to s . C is now wast .        Sample Input 2 9
different
different
different      Sample Output 2 0  If A, B and C are already equal in the beginning, the number of operations required is 0 .       Sample Input 3 7
zenkoku
touitsu
program      Sample Output 3 13

Solution (Python):
import sys
def input():
	return sys.stdin.readline().strip()


N = int(input())
A = input()
B = input()
C = input()

ans = 0

for i in range(N):
	if A[i] == B[i] and B[i] == C[i]:
		ans += 0
	elif A[i] == B[i] or B[i] == C[i] or C[i] == A[i]:
		ans += 1
	else:
		ans += 2

print(ans)

Solution (Python):
N=int(input())
A,B,C=[input() for i in range(3)]
ans=0
for i in range(N):
    if A[i]!=B[i] and A[i]!=C[i] and B[i]!=C[i]:
        ans+=2
    elif A[i]!=B[i] or A[i]!=C[i]:
        ans+=1
print(ans)

Solution (Python):


N, A, B, C = int(input()), input(), input(), input()
cnt = 0
for i in range(N):
    if A[i] == B[i] and A[i] == C[i]:
       pass
    elif (A[i] == B[i] and A[i] != C[i]) or (A[i] == C[i] and A[i] != B[i]) or (B[i] == C[i] and A[i] != B[i]):
        cnt += 1
    else:
        cnt += 2
print(cnt)

Solution (Python):
N=int(input())
A,B,C=input(),input(),input(),

ans=0
for i in range(N):
  if A[i]==B[i]==C[i]:
    ans+=0
  elif A[i]!=B[i] and A[i]!=C[i] and B[i]!=C[i]:
    ans+=2
  else:
    ans+=1
  
print(ans)

Solution (Python):
def resolve():
    n = int(input())
    a = input()
    b = input()
    c = input()
    ans = 0
    for ai, bi, ci in zip(a, b, c):
        ans += len({ai, bi, ci}) - 1
    print(ans)


if __name__ == "__main__":
    resolve()

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()

diff_ch=[]
for i in range(n):
    diff_ch.append(len(set([a[i],b[i],c[i]]))-1)
print(sum(diff_ch))

Solution (Python):

def main():
    N, *S = open(0).read().split()
    ans = 0
    for i in zip(*S):
        x = len(set(i))
        if x == 3:
            ans += 2
        elif x == 2:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(n):
  if a[i]==b[i] and b[i]==c[i]:
    pass
  elif a[i]==b[i]:
    ans += 1
  elif b[i]==c[i]:
    ans += 1
  elif c[i]==a[i]:
    ans += 1
  else:
    ans += 2
print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
r = 0
for i in range(N):
  a, b, c = A[i], B[i], C[i]
  if a == b == c:
    continue
  elif a == b or b == c or c == a:
    r += 1
  else:
    r += 2
print(r)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()

ans=0
for i in range(n):
    x,y,z=a[i], b[i], c[i]
    if x==y and y==z:
        continue
    elif x!=y and y!=z and z!=x:
        ans+=2
    else:
        ans+=1
print(ans)

Solution (Python):
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)

from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque


def main():
    num = int(input())
    data = [input() for i in range(3)]

    ans = 0
    for i in range(num):
        aaa = set([data[0][i], data[1][i], data[2][i]])
        ans += len(aaa) - 1
    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):

def main():

    N = int(input())
    A = input()
    B = input()
    C = input()

    count = 0
    for i in range(N):
        if A[i] == B[i] == C[i]:
            pass
        elif A[i] == B[i]:
            count += 1
        elif A[i] == C[i]:
            count += 1
        elif B[i] == C[i]:
            count += 1
        else:
            count += 2
    return count

if __name__ == '__main__':
    print(main())

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
	if a[i]==b[i]==c[i]:
		continue
	elif a[i]==b[i] or b[i]==c[i]\
	or c[i]==a[i]:
		ans+=1
	else:
		ans+=2
print(ans)

Solution (Python):
N=int(input())

A=input()
B=input()
C=input()

list=[]
for i in range(N):
    a=A[i]
    b=B[i]
    c=C[i]

    if a==b and b==c:
        list.append(0)
    elif (a==b and b!=c) \
        or (a==c and a!=b) \
        or (b==c and a!=c):
        list.append(1)
    elif a!=b and b!=c and c!=a:
        list.append(2)

print(sum(list))

Solution (Python):
def solve(n, a, b, c):
    ans = 0
    for i in range(n):
        ans += len(set([a[i], b[i], c[i]])) - 1
    return ans

n = int(input())
a = input()
b = input()
c = input()
print(solve(n, a, b, c))

Solution (Python):
n = int(input())
a = str(input())
b = str(input())
c = str(input())
result = 0
for i in range(n):
    counter = 1
    if a[i] == b[i]:
        counter += 1
    if a[i] == c[i]:
        counter += 1
    elif b[i] == c[i]:
        counter += 1
    result += abs(3-counter)
print(result)

Solution (Python):
n,a,b,c=open(0);print(sum([0,1,2][(len(set(d))>1)+(len(set(d))>2)]for d in zip(a,b,c)))

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
count = 0
for i in range(n):
    ab = a[i] + b[i]
    bc = b[i] + c[i]
    ca = c[i] + a[i]
    count += 2 - max(ab.count(c[i]), bc.count(a[i]), ca.count(b[i]))
print(count)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
count = 0

for i in range(N):
    if A[i] == B[i] == C[i]:
        count += 0
    elif A[i] == B[i] and A[i] != C[i]:
        count += 1
    elif A[i] == C[i] and A[i] != B[i]:
        count += 1
    elif B[i] == C[i] and B[i] != A[i]:
        count += 1
    else:
        count += 2

print(count)

Solution (Python):
n=int(input())
da=[input() for i in range(3)]
ans=0
for i in range(n):
    ans+=len(set([da[0][i],da[1][i],da[2][i]]))-1
print(ans)

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
    a,b,c = A[i],B[i],C[i]
    L = len(set([a,b,c]))
    ans += L-1

print(ans)

Solution (Python):
N = int(input())
A = str(input())
B = str(input())
C = str(input())
ans = 0
for i in range(0, N):
    tmp = set()
    tmp.add(A[i])
    tmp.add(B[i])
    tmp.add(C[i])
    ans += (len(tmp)-1)
print(ans)

Solution (Python):

n = int(input())
a = input()
b = input()
c = input()

ans = 0
for i in range(n):
    ans += len(set([a[i],b[i],c[i]]))-1
print(ans)

Solution (Python):
n = int(input())
a, b, c = [ input() for i in range(3) ]
print(sum([ len(set([a[i], b[i], c[i]])) - 1 for i in range(n) ]))

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  if(a[i]!=b[i] and b[i]!=c[i] and c[i]!=a[i]):
    ans += 2
  elif(not(a[i]==b[i]==c[i])):
    ans += 1
print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

ans = 0

for i in range(N):
    if A[i] == B[i] and B[i] != C[i]:
        ans += 1
    elif A[i] != B[i] and B[i] == C[i]:
        ans += 1
    elif A[i] == C[i] and B[i] != C[i]:
        ans += 1
    elif A[i] != B[i] and B[i] != C[i]:
        ans += 2
print(ans)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

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

print(ans)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
    ans+=len(set([a[i],b[i],c[i]]))-1
print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()


ans = 0
for i in range(n):
  array = [a[i],b[i],c[i]]
  setarray = set(array)
  ans += len(setarray)-1
  
print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for a, b, c in zip(A, B, C):
    ans += len(set([a, b, c])) - 1
print(ans)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

ans = 0
for i in range(N):
    if A[i] == B[i] == C[i]:
        pass
    elif A[i] ==B[i] or B[i] == C[i] or C[i] == A[i]:
        ans += 1
    else:
        ans += 2

print (ans)

Solution (Python):
n=int(input());a=[];b=[2,1,0,0];x=0
for i in range(3):
  a.append(input())
for j in range(n):
  m=0
  if a[0][j]==a[1][j]:m+=1
  if a[1][j]==a[2][j]:m+=1
  if a[2][j]==a[0][j]:m+=1
  x+=b[m]
print(x)

Solution (Python):
n = int(input())
a = list(input())
b = list(input())
c = list(input())

cnt = 0

for i in range(n):
    if a[i] != b[i] and a[i] != c[i] and b[i] != c[i]:
        cnt += 2
    elif a[i] == b[i] and a[i] == c[i] and b[i] == c[i]:
        cnt += 0
    else:
        cnt += 1

print(cnt)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()
ans=0
for i in range(N):
  ans+=len(set([A[i],B[i],C[i]]))-1
print(ans)

Solution (Python):
N=int(input())
A=str(input())
B=str(input())
C=str(input())

s = 0
for i in range(N):
    s+=1 if A[i]!=B[i] else 0
    s+=1 if B[i]!=C[i] else 0
    s+=1 if C[i]!=A[i] else 0
    s+=1 if A[i]==B[i] and B[i]==C[i] else 0
    s-=1
print(s)

Solution (Python):
import sys
n = int(input())
a,b,c = sys.stdin
count = 0
for i in range(n):
  if a[i] == b[i] == c[i]:
    continue
  elif a[i] == b[i] or a[i] == c[i] or b[i] == c[i]:
    count += 1
  else:
    count += 2
print(count)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

count = 0 

for i in range(N):
	if A[i] == B[i] and A[i] == C[i]:
		continue
	elif A[i] == B[i] or A[i] == C[i] or B[i] == C[i]:
		count +=1
	else:
		count +=2
print(count)

Solution (Python):
N = int(input())
A = input()
B = input()
C = 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 and b == c:
        ans += 0
    else:
        ans += 1

print(ans)

Solution (Python):
n=int(input())
l=[input() for i in range(3)]
ans=0
for i in range(n):
  a=set([l[0][i],l[1][i],l[2][i]])
  ans+=len(a)-1
print(ans)

Solution (Python):
n = int(input())
A = input().rstrip()
B = input().rstrip()
C = input().rstrip()
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 and b !=c) or (b!= c and c != a) or (c != a and a != b):
        ans += 1
print(ans)

Solution (Python):
N = int(input())
A, B, C = input(), input(), input()

count = 0
for n in range(N):
	a, b, c = A[n], B[n], C[n]
	if a == b == c:
		continue
	if a == b or b == c or c == a:
		count += 1
		continue
	count += 2
print(count)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()

ans=0

for a,b,c in zip(A,B,C):
    ans+=len(set((a,b,c)))-1

print(ans)

Solution (Python):

def main():
    n = int(input())
    S = [input().rstrip() for _ in range(3)]
    ans = 0
    for i in zip(S[0], S[1], S[2]):
        if len(set(i)) == 3:
            ans += 2
        elif len(set(i)) == 2:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  aa,bb,cc=a[i],b[i],c[i]
  if aa==bb:
    if cc!=aa:
      ans+=1
  else:
    if cc!=aa and cc!=bb:
      ans+=2
    else:
      ans+=1
print(ans)

Solution (Python):
n=int(input())
a,b,c=input(),input(),input()
ans=0
for i in range(n):
    s=set([a[i],b[i],c[i]])

    l=len(s)
    ans+=(l-1)
print(ans)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()
ans=0
for i,k,t in zip(A,B,C):
  if i==k==t:
    ans=ans
  elif i!=k and k!=t and t!=i:
    ans+=2
  else:
    ans+=1  
print(ans)

Solution (Python):
N = int(input())
A = input().rstrip()
B = input().rstrip()
C = input().rstrip()

ans = 0
for z in zip(A, B, C):
    ans += len(set(z)) - 1
print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

count = 0

for i in range(n):
  if a[i] == b[i]:
    if a[i] != c[i]:
      count += 1
  elif a[i] == c[i]:
    count += 1
  elif b[i] == c[i]:
    count += 1
  else:
    count += 2
    
print(count)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

answer = 0

for i in range(n):
    int_w = len(set([a[i], b[i], c[i]]))

    if int_w == 3:
        answer += 2
    elif int_w == 2:
        answer += 1
    else:
        pass


print(answer)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
cnt = 0
for i in range(n):
    cnt += len(set([a[i], b[i], c[i]])) - 1
print(cnt)

Solution (Python):
n=int(input())
s=[list(input()) for _ in range(3)]
cnt=0
for i in range(n):
    l=len(set([s[0][i],s[1][i],s[2][i]]))
    if l==2:
        cnt+=1
    elif l==3:
        cnt+=2
print(cnt)

Solution (Python):
N = int(input())
A,B,C = [input() for _ in range(3)]

answer = 0
for a,b,c in zip(A,B,C):
  answer += len(set([a,b,c])) - 1

print(answer)

Solution (Python):
n = int(input())
abc = []
for _ in range(3):
    abc.append(str(input()))
cnt = 0
for i in range(n):
    if abc[0][i]==abc[1][i]==abc[2][i]:
        cnt += 0
    elif (abc[0][i]==abc[1][i]!=abc[2][i])\
        or (abc[1][i]==abc[2][i]!=abc[0][i])\
        or (abc[2][i]==abc[0][i]!=abc[1][i]):
        cnt += 1
    else:
        cnt += 2
print(cnt)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for (a,b,c) in zip(A,B,C):
    ans+=len(set([a,b,c]))-1
print(ans)

Solution (Python):

N = int(input())
A = str(input())
B = str(input())
C = str(input())


ans = 0

for i in range(N):
    if A[i] is B[i] and A[i] is C[i]:
        pass
    elif A[i] is B[i] and B[i] is not C[i] and A[i] is not C[i]:
        ans += 1
    elif B[i] is C[i] and B[i] is not A[i] and C[i] is not A[i]:
        ans += 1
    elif A[i] is C[i] and A[i] is not B[i] and C[i] is not B[i]:
        ans += 1
    else:
        ans += 2

print(ans)

Solution (Python):

import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())


N = int(input())
A = input()
B = input()
C = input()

ans = 0
for a, b, c in zip(A, B, C):
  ans += len(set((a,b,c)))-1

print(ans)

Solution (Python):


N = int(input())
A = list(input() + input() + input())
counter = 0
time = 0
while counter < N:
    if A[counter] == A[counter + N] and A[counter] == A[counter + N*2]:
        time += 2
        counter += 1
    elif A[counter] == A[counter + N]:
        time += 1
        counter += 1
    elif A[counter] == A[counter + N*2]:
        time += 1
        counter += 1
    elif A[counter + N] == A[counter + N*2]:
        time += 1
        counter += 1
    else:
        time += 0
        counter += 1
print(2*N - time)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
x=0
for i in range(n):
    if a[i]==b[i]==c[i]:pass
    elif a[i]==b[i] or b[i]==c[i] or c[i]==a[i]:x+=1
    else:x+=2
print(x)

Solution (Python):
N = int(input())
ABC = [list(input()) for _ in range(3)]

print(sum([len(set(abc)) - 1 for abc in zip(*ABC)]))

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()

print(sum([len(set([A[i],B[i],C[i]]))-1 for i in range(N)]))

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
cnt = 0
for i in range(N):
	if A[i] == B[i] == C[i]:
		pass
	elif A[i] != B[i] and B[i] != C[i] and C[i] != A[i]:
		cnt += 2
	else:
		cnt += 1
print(cnt)

Solution (Python):
n = int(input())
a = str(input())
b = str(input())
c = str(input())
d = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        pass
    elif a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        d += 2
    else:
        d += 1
print(d)

Solution (Python):
N = int(input())
A, B, C = input(), input(), input()
ans = 0
for i in range(N):
    if A[i] == B[i] == C[i]:
        pass
    elif A[i] != B[i] and B[i] != C[i] and C[i] != A[i]:
        ans += 2
    else:
        ans += 1
print(ans)

Solution (Python):
N = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(N):
    if a[i] == b[i] == c[i]:
        pass
    elif a[i] == b[i] or a[i] == c[i] or b[i] == c[i]:
        ans += 1
    else:
        ans += 2
print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for a, b, c in zip(A, B, C):
    xs = set([a, b, c])
    if len(xs) == 1:
        ans += 0
    elif len(xs) == 2:
        ans += 1
    else:
        ans += 2

print(ans)

Solution (Python):
n = int(input())
A = input()
B = input()
C = input()
cnt = 0
for i in range(n):
    a = A[i]
    b = B[i]
    c = C[i]
    if a == b == c:
        continue
    elif a == b or b == c or c == a:
        cnt += 1
    else:
        cnt += 2
print(cnt)

Solution (Python):
if __name__=="__main__":
    n = input()
    A = input()
    B = input()
    C = input()
    ans = 0
    for a, b, c in zip(A, B, C):
        if a != b and a != c and b != c:
            ans += 2
        elif a == b and b == c :
            pass
        else:
            ans += 1
    print(ans)

Solution (Python):
n=int(input())
arr=[input() for _ in range(3)]
ans=0
for i in range(n):
  if arr[0][i]==arr[1][i] and arr[1][i]==arr[2][i]:
    tmp=0
  elif arr[0][i]==arr[1][i] or arr[1][i]==arr[2][i] or arr[2][i]==arr[0][i]:
    tmp=1
  else:
    tmp=2
  ans+=tmp
print(ans)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
cnt=0
for i in range(n):
    if a[i]==b[i]==c[i]:
        continue
    if a[i]!=b[i] and a[i]!=c[i] and b[i]!=c[i]:
        cnt+=2
    else:
        cnt+=1
print(cnt)

Solution (Python):
n = int(input())
s1 = input()
s2 = input()
s3 = input()

ans = 0
for i in range(n):
  if s1[i] == s2[i] and s2[i] == s3[i]:
    pass
  elif s1[i] == s2[i] or s1[i] == s3[i] or s2[i] == s3[i]:
    ans += 1
  else:
    ans += 2
print(ans)

Solution (Python):

import sys


def solve(N: int, A: str, B: str, C: str):
    ret = 0
    for i in range(N):
        if A[i] == B[i] == C[i]:
            ret += 0
        elif A[i] == B[i] or B[i] == C[i] or A[i] == C[i]:
            ret += 1
        else:
            ret += 2
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = next(tokens)  
    B = next(tokens)  
    C = next(tokens)  
    solve(N, A, B, C)

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  if a[i]==b[i]:
    if not b[i]==c[i]:
      ans+=1
  else:
    if b[i]==c[i]:
      ans+=1
    elif a[i]==c[i]:
      ans+=1
    else:
      ans+=2
print(ans)

Solution (Python):
n = int(input())
A = input()
B = input()
C = input()
a = [0] * n
for i in range(n):
  if (A[i] == B[i] == C[i]):
    a[i] += 0
  elif (A[i] == B[i] or B[i] == C[i] or A[i] == C[i]):
    a[i] += 1
  else:
    a[i] += 2

print(sum(a))

Solution (Python):
N = int(input())
A, B, C = input(), input(), input()
ans = 0
for i in range(N):
    ans += len(set([A[i], B[i], C[i]])) - 1
print(ans)

Solution (Python):
_,*t=open(0);print(sum(len(set(s))-1for s in zip(*t)))

Solution (Python):
n = int(input())
A = input()
B = input()
C = input()
a = [0] * n
for i in range(n):
  if (A[i] == B[i] and A[i] != C[i]):
    a[i] += 1
  elif (A[i] == C[i] and A[i] != B[i]):
    a[i] += 1
  elif (B[i] == C[i] and A[i] != B[i]):
    a[i] += 1
  elif (A[i] == B[i] and B[i] == C[i]):
    a[i] += 0
  else:
    a[i] += 2

print(sum(a))

Solution (Python):
n = int(input())
a = input().strip()
b = input().strip()
c = input().strip()
ans = 0
for _a, _b, _c in zip(a, b, c):
  if _a != _b and _b != _c and _a != _c:
    ans += 2
  elif _a == _b and _b == _c:
    continue
  else:
    ans += 1
print(ans)

Solution (Python):
N = int( input() )
A = input()
B = input()
C = input()


ans = 0
for i in range(N):
    if A[i] == B[i] and B[i] != C[i]: ans += 1
    if A[i] != B[i] and B[i] == C[i]: ans += 1
    if A[i] != B[i] and A[i] == C[i]: ans += 1
    if A[i] != B[i] and B[i] != C[i] and C[i] != A[i]: ans += 2

print( ans )

Solution (Python):
n = int(input())
s = [input() for _ in range(3)]
ans = 0
for i in range(n):
    ans += len({s[0][i], s[1][i], s[2][i]})-1
print(ans)

Solution (Python):
n=int(input());aa=[input()for i in range(3)];ans=0
for i in range(n):
  a,b,c=aa[0][i],aa[1][i],aa[2][i]
  if not a==b==c:
    if a!=b!=c!=a:ans+=2
    else:ans+=1
print(ans)

Solution (Python):
n = int(input())
listA = list(input())
listB = list(input())
listC = list(input())


counter=0
index=0
while index < n:
    if listA[index] == listB[index] and listB[index] == listC[index]:
        pass
    elif listA[index] != listB[index] and listB[index] != listC[index] and listC[index]!=listA[index]:
        counter+=2
    else:
        counter+=1
    index+=1
print(counter)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0

for i in range(N):
    if A[i] == B[i] and B[i] == C[i]:
        continue
    elif A[i] != B[i] and B[i] != C[i] and C[i] != A[i]:
        ans += 2
    else:
        ans += 1

print(ans)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
  if A[i]!=B[i] and A[i]!=C[i] and B[i]!=C[i]:
    ans += 2
  elif A[i]!=B[i] or A[i]!=C[i] or B[i]!=C[i]:
    ans += 1
print(ans)

Solution (Python):
from collections import Counter
n = int(input())
a = input()
b = input()
c = input()

count = 0
for i in range(n):
    co = Counter([a[i], b[i], c[i]])
    count += 3-max(co.values())

print(count)

Solution (Python):
n = int(input())
a = str(input())
b = str(input())
c = str(input())
count = 0
for i in range(n):
  if a[i] == b[i] and b[i] == c[i]:
    continue
  elif a[i]== b[i] or a[i]==c[i] or b[i]==c[i]:
    count += 1
  else:
    count+=2
print(count)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()
print(sum([0 if A[i]==B[i]==C[i] else 2 if A[i]!=B[i]!=C[i]!=A[i] else 1 for i in range(N)]))

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

res = 0

for i in range(N):
    set_num = len(set([A[i],B[i],C[i]]))
    if set_num == 3:
        res += 2
    elif set_num == 2:
        res += 1

print(res)

Solution (Python):
n = int(input())
a = list(input())
b = list(input())
c = list(input())
cnt = 0

for i in range(n):
    if a[i] == b[i] and b[i] == c[i] and c[i] == a[i]:
        cnt += 0
    elif a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        cnt += 1
    else:
        cnt += 2

print(cnt)

Solution (Python):
n = int(input())
s = [input() for _ in range(3)]
cnt = -n
for i in range(n):
  cnt += len(set([j[i] for j in s]))
print(cnt)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
    if (A[i] is B[i]) & (A[i] is C[i]):
        ans += 0
    elif (A[i] is B[i]) | (B[i] is C[i]) | (A[i] is C[i]):
        ans += 1
    else:
        ans += 2
print(ans)

Solution (Python):
from collections import Counter
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
    naga = len(set([A[i],B[i],C[i]]))
    if naga == 3:
        ans+=2
    if naga == 2:
        ans+=1
print(ans)

Solution (Python):
import collections

N = int(input())
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
    l = []
    l.append(A[i])
    l.append(B[i])
    l.append(C[i])
    c = collections.Counter(l)
    c_len = len(c)
    if c_len == 2:
        ans += 1
    elif c_len == 3:
        ans += 2

print(ans)

Solution (Python):
int(input())
a = str(input())
b = str(input())
c = str(input())
def f(a,b,c):
    ans = 0
    for i in range(len(a)):
        if a[i] != b[i]:
            ans += 1
        if a[i] != c[i] and c[i] != b[i]:
                ans += 1 
    return ans
ans = min(f(a,b,c),f(b,c,a),f(c,a,b))
print(ans)

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
x=[[a[i],b[i],c[i]] for i in range(n)]
y=[max([t.count(t[0]),t.count(t[1]),t.count(t[2])]) for t in x]
print(3*n-sum(y))

Solution (Python):
"""
A - Subscribers
"""


def solve():
    N = int(input())
    A = input()
    B = input()
    C = input()
    change_count = 0
    for i in range(N):
        if A[i] == B[i] == C[i]:
            pass
        elif (A[i] == B[i] or
              A[i] == C[i] or
              B[i] == C[i]):
            change_count += 1
        else:
            change_count += 2
    print(change_count)


if __name__ == '__main__':
    solve()

Solution (Python):
N=int(input())
A=str(input())
B=str(input())
C=str(input())
n=0

for i in range(0,N,1):
  if A[i]==B[i] and A[i]==C[i]:
    n+=0
    continue
  elif A[i]==B[i] or A[i]==C[i] or B[i]==C[i]:
    n+=1
    continue
  else:
    n+=2

print(n)

Solution (Python):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

operations = 0
for i in range(N):
    if A[i] == B[i] and B[i] == C[i]:
        continue
    elif A[i] == B[i] or B[i] == C[i] or C[i] == A[i]:
        operations += 1
    else:
        operations += 2

print(operations)

Solution (Python):
n = int(input())
a = list(input())
b = list(input())
c = list(input())
counter = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        counter += 0
    elif a[i] == b[i] or b[i] == c[i] or a[i] == c[i]:
        counter += 1
    else:
        counter += 2
print(counter)

Solution (Python):
input()
A, B, C = input(), input(), input()
print(sum([len(set([a, b, c])) - 1 for a, b, c in zip(A, B, C)]))

Solution (Python):
n = input()
a = input()
b = input()
c = input()
count = 0
for i in range(int(n)):
    d = set([a[i], b[i], c[i]])

    if len(d) == 3:
        count += 2
    elif len(d) == 2:
        count += 1
    else:
        pass

print(count)

Solution (Python):
n = int(input())
a = str(input())
b = str(input())
c = str(input())

p = 0
for i in range(n):
    t = 0
    if(a[i] != b[i]):
        t += 1
    if(b[i] != c[i]):
        t += 1
    if(a[i] != c[i]):
        t += 1

    if(t == 3):
        p += 2
    elif(t == 0):
        pass
    else:
        p += 1
print(p)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()

num=0
for i in range(N):
    str=[]
    str.append(A[i])
    str.append(B[i])
    str.append(C[i])
    num=num+len(set(str))-1
print(num)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

res = 0
for i in range(N):
  ab = (A[i] == B[i])
  bc = (B[i] == C[i])
  ca = (C[i] == A[i])
  s = ab*1 + bc*1 + ca*1

  if (0 == s):
    res += 2
  elif (1 == s):
    res += 1
print(res)

Solution (Python):
n=int(input())
a=[list(input())for i in range(3)]
cnt=0
for i in range(n):
    tmp=[]
    tmp.append(a[0][i])
    tmp.append(a[1][i])
    tmp.append(a[2][i])
    cnt+=len(list(set(tmp)))-1
print(cnt)

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()
count=0
for i in range(0,N):
    if A[i]==B[i]==C[i]:
        count=count
    elif A[i]==B[i] or A[i]==C[i] or B[i]==C[i]:
        count=count+1
    else:
        count=count+2
print(count)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()

ans = 0

for i in range(n):
    if a[i] != b[i]:
        ans += 1
    if a[i] != c[i] and b[i] != c[i]:
        ans += 1
        
print(ans)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    N = int(input())
    A = input()
    B = input()
    C = input()

    ans = 0
    for i in range(N):
        a, b, c = A[i], B[i], C[i]
        n = len(set([a, b, c]))
        if n == 2:
            ans += 1
        elif n == 3:
            ans += 2
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):



N = int(input())

w = [input() for i in range(3)]

c = 0

for i in range(N):
    if w[0][i]!=w[1][i]:
        c += 1
    
    if (w[0][i]!=w[2][i]) and (w[1][i]!=w[2][i]):
        c += 1

print(c)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
  if A[i] != B[i] and B[i] != C[i] and C[i] != A[i]:
    ans += 2
  elif A[i] == B[i] != C[i] or A[i] != B[i] == C[i] or C[i] == A[i] != B[i]:
    ans += 1
  else:
    ans += 0
print(ans)

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18

N = input()
A = raw_input()
B = raw_input()
C = raw_input()

ans = 0
for i in range(N):
    m = {A[i], B[i], C[i]}
    ans += len(m) - 1

print ans

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()

answer = A
def calc_answer(answer):
    answer = answer
    for i in range(N):
        ver = [A[i], B[i], C[i]]
        same_index = get_same_index(ver)
        if same_index == (1,2):
            answer_lis = list(answer)
            answer_lis[i] = B[i]
            answer = ''
            for k in answer_lis:
                answer += k
    return answer

def get_same_index(lis):
    if lis[0] == lis[1] == lis[2]:
        return 0, 1, 2
    if lis[0] == lis[1]:
        return 0, 1
    if lis[1] == lis[2]:
        return 1, 2
    if lis[2] == lis[0]:
        return 0, 2
    else:
        return -1


def get_differency(answer):
    differency = 0
    answer = calc_answer(answer)
    for i in range(N):
        if answer[i] != A[i]:
            differency += 1
        if answer[i] != B[i]:
            differency += 1
        if answer[i] != C[i]:
            differency += 1
    return differency

differency = get_differency(answer)
print(differency)

Solution (Python):
N = int(input())
A = str(input())
B = str(input())
C = str(input())
count = 0
for i in range(0,N,1):
  if (A[i] != B[i] and A[i] != C[i] and B[i] != C[i]):
    count += 2
  elif (A[i] == B[i] and A[i] != C[i]) or \
       (A[i] == C[i] and A[i] != B[i]) or \
       (B[i] == C[i] and A[i] != B[i]):
    count += 1
print(count)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
count = 0
for num in range(N) :
    count += len(list(set(list( [ A[num], B[num], C[num] ] ) ) )) - 1
print(count)