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):
n = input()
a = input()
b = input()
c = input()

la = list(a)
lb = list(b)
lc = list(c)

total = 0
for i in range(int(n)):
    count = 0
    if la[i] != lb[i]:
        count += 1
    if la[i] != lc[i]:
        count += 1
    if lb[i] != lc[i]:
        count += 1

    if count == 3:
        total += 2
    elif count == 2:
        total += 1
    elif count == 1:
        total += 1
    else:
        total += 0

print(total)

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

count = 0

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

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] and b[i]==c[i]:
        continue
    elif a[i]==b[i] or c[i]==b[i] or a[i]==c[i]:
        count += 1
    else:
        count += 2
print(count)

Solution (Python):

 
import sys
import math

n = int(input())

s = []

for i in range(3):
    s.append(input())

num = 0
for i in range(n):
    if s[0][i] == s[1][i] == s[2][i]:
        num = num
    elif s[0][i] == s[1][i]:
        num += 1
    elif s[0][i] == s[2][i]:
        num += 1
    elif s[1][i] == s[2][i]:
        num += 1
    else:
        num += 2


print(num)

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

t = n * 2;

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

Solution (Python):
N = int(input())
list = [input(), input(), input()]
c = 0
for n in range(N):
    if list[0][n] == list[1][n]:
        if list[0][n] != list[2][n]:
            c += 1
        continue
    if list[0][n] == list[2][n]:
        if list[0][n] != list[1][n]:
            c += 1
        continue
    if list[1][n] == list[2][n]:
        if list[0][n] != list[1][n]:
            c += 1
        continue
    c += 2

print(c)

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] and B[i]!=C[i]):
        count += 2
    elif(A[i]==B[i] or C[i]==B[i] or A[i]==C[i]):
        count += 1

for i in range(N):
    if(A[i]==B[i] and A[i]==C[i]):
        count -= 1


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 b[i] == c[i]:
        continue
    elif a[i] == b[i] or b[i] == c[i] or a[i] == c[i]:
        count += 1
    else:
        count += 2

print(count)

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

count = 0
sum = 0

for i in range(N):
    
    ilist = list([A[i], B[i], C[i]])
    iuniq = list(set(ilist))
    sum = sum + len(iuniq)-1

print(sum)

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


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

print(count)

Solution (Python):
def main(N, A, B, C):
    tot = 0
    for i in range(N):
        fab = A[i] == B[i]
        fac = A[i] == C[i]
        fbc = B[i] == C[i]
        if fab and fac:
            continue
        elif fab or fac or fbc:
            tot += 1
        else:
            tot += 2
    print(tot)

if __name__ == "__main__":
    N = int(input())
    A = input()
    B = input()
    C = input()
    main(N, A, B, C)

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)]
cnt=0

a_=list(a)
b_=list(b)
c_=list(c)

for i in range(n):
  cnt += len(list({a_[i],b_[i],c_[i]}))-1

print(cnt)

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
m = [0, 0, 1, 2]
op = 0
for i in range(N):
    chars = len({A[i], B[i], C[i]})
    op += m[chars]
print(op)

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]:
        pass
      else:
        count += 1
    elif A[i] == C[i]:
      count += 1
    elif B[i] == C[i]:
      count += 1
    else:
      count += 2

print(count)

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

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

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
abc=list('0'*n)
for i in range(n):
    if a[i]==b[i]:
        abc[i]=a[i]
    if b[i]==c[i]:
        abc[i]=b[i]
    if c[i]==a[i]:
        abc[i]=c[i]
    if abc[i]=='0':
        abc[i]=a[i]
count=0
for i in range(n):
    if a[i]!=abc[i]:
        count+=1
    if b[i]!=abc[i]:
        count+=1
    if c[i]!=abc[i]:
        count+=1
print(count)

Solution (Python):
n=int(input())
word=[]
word.append(input())
word.append(input())
word.append(input())
count=0
for i in range(len(word[0])):
    if word[0][i] != word[1][i] and word[1][i] != word[2][i] and word[0][i] != word[2][i]:
        count+=2
    elif word[0][i] != word[1][i] or word[1][i] != word[2][i]:
        count+=1
    else:
        pass
print(count)

Solution (Python):

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

if A == B and B == C:
	print(0)
else:
	counter = 0
	for j, k, l in zip(A,B,C):
		if j == k and k == l:
			pass
		elif j == k or k == l or j == l:
			counter += 1
		else:
			counter += 2

	print(counter)

Solution (Python):
from sys import stdin
import numpy as np
N=int(stdin.readline().rstrip())
A=[x for x in input()]
B=[x for x in input()]
C=[x for x in input()]
arr=[A,B,C]
arr=np.array(arr)
ans=0
cnt=0
for i in range(N):
    if len(set(arr[:,i]))==3:
        ans+=3
        cnt+=1
    else:
        if len(set(arr[:,i])) != 1:
            ans+=(3-len(set(arr[:,i])))
print(ans-cnt)

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

count=0
for i,word in enumerate(A):

    if B[i]==C[i]:
        if B[i]==C[i] and B[i]==A[i]:
            count=count+1
        count=count-1
    if B[i]!=word:
        count=count+1
    if C[i]!=word:
        count=count+1

print(count)

Solution (Python):
N = int(input())
S = []
S.append([c for c in input()])
S.append([c for c in input()])
S.append([c for c in input()])

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

Solution (Python):
n, a, b, c = [input() for i in range(4)]
n = int(n)

ret = 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]):
        c = c[:i] + a[i] + c[i + 1:]
        ret += 1

    elif a[i] == c[i] and a[i] != b[i]:
        b = b[:i] + a[i] + b[i + 1:]
        ret += 1

    elif a[i] != c[i] and b[i] == c[i]:
        a = a[:i] + b[i] + a[i + 1:]
        ret += 1

    elif a[i] != b[i] and a[i] != c[i]:
        b = b[:i] + a[i] + b[i + 1:]
        c = c[:i] + a[i] + c[i + 1:]
        ret += 2


print(ret)

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

str_len = len(A)

count = 0


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

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

a = list(A)    
b = list(B)
c = list(C)

count = 0
for i in range(0,N):
    if a[i] == b[i] and a[i] == c[i]:
        count += 0
    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()


def get_intersection(s1, s2):
    

    ret = []

    for i in range(len(s1)):
        if s1[i] == s2[i]:
            ret.append(i)

    return ret


cm_ab = set(get_intersection(a,b))
cm_ac = set(get_intersection(a,c))
cm_bc = set(get_intersection(b,c))


all = set(range(n))
ncm_a = all - (cm_ab | cm_ac)
ncm_b = all - (cm_ab | cm_bc)
ncm_c = all - (cm_ac | cm_bc)


ncm_sum = len(ncm_a)+len(ncm_b)+len(ncm_c)
ncm_all_len = len(all - (cm_ab | cm_bc | cm_ac))

print(ncm_sum - ncm_all_len)

Solution (Python):
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
A = S()
B = S()
C = S()

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

print(cnt)

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

ans = 0
for i in range(N):
    tmp = list(A[i] + B[i] + C[i])
    cnt = Counter(tmp)
    max_cnt = max(cnt.values())

    if max_cnt == 3:
        
        pass
    else:
        
        
        ans = ans + (3 - max_cnt)

print(ans)

Solution (Python):
import sys
import numpy as np

def parse(inp):
    N=int(next(inp))
    
    wordlist=np.array([list(next(inp))])
    for i in range(2):
        wordlist=np.append(wordlist,np.array([list(next(inp))]),axis=0)



    return N,wordlist

def main(inp):
    N,wordlist=parse(inp)
    sousa=0
    total=np.array([],dtype=int)
    
    tf01=(wordlist[0]==wordlist[1])
    tf02=(wordlist[0]==wordlist[2])
    tf12=(wordlist[1]==wordlist[2])

    for i in range(N):
        total=np.append(total,sum([tf01[i],tf02[i],tf12[i]]))

    
    for i in range(N):
        if(total[i]==0):
            sousa+=2
        elif(total[i]==1):
            sousa+=1
        else:
            continue
    
    return sousa
  
print(main(sys.stdin))

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

s = []
for i in range(3):
    s.append(input())

ans = 0
for i in range(N):
    s1 = s[0][i]
    s2 = s[1][i]
    s3 = s[2][i]

    if s1==s2 and s2==s3 and s1==s3:
        ans += 0
    elif s1==s2 or s1==s3 or s2==s3:
        ans += 1
    else:
        ans += 2

print(ans)

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] == C[i]:
        count += 1
    elif B[i] == C[i]:
        count += 1
    elif A[i] == B[i]:
        count += 1
    else:
        count += 2
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] and b[i] == c[i] and c[i] == a[i]:
        pass
    elif a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        count += 2
    else:
        count += 1

print(count)

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

n = 0
for a, b, c in zip(list(A), list(B), list(C)):
    if a == b:
        if c != a:
            n += 1
    else:
        if c != a:
            n += 1
        if c != b:
            n += 1

print(n)

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


cnt = 0
i = 0
while True:
    if i >= N:
        i = 0
    if A == B and B == C:
        break
    if  A[i] != B[i] and B[i] != C[i]:
        B[i] = A[i]
        
        cnt += 1
    elif A[i] == B[i] and B[i] != C[i]:
       C[i] = B[i]
       cnt += 1
    elif A[i] != B[i] and B[i] == C[i]:
        A[i] = B[i]
        cnt += 1
    elif A[i] != B[i] and A[i] == C[i]:
        B[i] = A[i]
        cnt += 1
    i += 1

print(cnt)

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

a = list(A)
b = list(B)
c = list(C)

ans = 0

for i,j in enumerate(a):
    if j == b[i] or j == c[i] or b[i] == c[i]:
        if j == b[i] == c[i]:
            continue
        ans += 1
    elif a[i] != b[i] != c[i]:
        ans += 2
    

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 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()

ans = 0
for i in range(N):
  if A[i] != B[i] and A[i] == C[i]: 
    ans += 1
  elif A[i] == B[i] and A[i] != C[i]: 
    ans += 1
  elif A[i] != B[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 = [i for i in input()]
B = [i for i in input()]
C = [i for i in input()]

countA = 0
countB = 0
countC = 0
countALL = 0

for i in range(N):
    if A[i] == B[i] and A[i] == C[i]:
        continue
    elif A[i] == B[i]:
        countC += 1
    elif B[i] == C[i]:
        countA += 1
    elif A[i] == C[i]:
        countB += 1
    else:
        countALL += 1


result = countA + countB + countC + int(countALL * 2)

print(result)

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

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

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

ans = 0

for i in range(N):
    alc = set()
    alc.add(a[i])
    alc.add(b[i])
    alc.add(c[i])
    r = len(alc)
    if r == 1:
        pass
    elif r == 2: 
        ans += 1
    elif r == 3:
        ans += 2
    else:
        raise Exception("nandeya")

print(ans)

Solution (Python):


def solve():
    N = int(input())
    A, B, C = [input() for _ in range(3)]
    res = sum(len({a,b,c})- 1 for a,b,c in zip(A,B,C))
    return str(res)
if __name__ == '__main__':
    print(solve())

Solution (Python):
def func(s, i):
    return s[:i] + '*' + s[i+1:]


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

for i in range(N):
    if A[i] == B[i] == C[i]:
        A = func(A, i)
        B = func(B, i)
        C = func(C, i)
    elif A[i] == B[i]:
        A = func(A, i)
        B = func(B, i)
    elif A[i] == C[i]:
        A = func(A, i)
        C = func(C, i)
    elif B[i] == C[i]:
        B = func(B, i)
        C = func(C, i)

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

print(ans)

Solution (Python):
n = int(raw_input())
a = raw_input().strip()
b = raw_input().strip()
c = raw_input().strip()
ans = 0
for x, y, z in zip(a, b, c):
    s = set([x, y, z])
    ans += len(s) - 1
print ans

Solution (Python):
input()

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

total = 0

for i in range(len(A)):
    s = set()
    s.add(A[i])
    s.add(B[i])
    s.add(C[i])

    total += len(s) - 1

print(total)

Solution (Python):
n = int(input())
abc_list = []
for i in range(3):
    abc_list.append(input())
ans = 0
diff = 0

for i in range(n):
    if abc_list[0][i] != abc_list[1][i]:
        diff += 1
    if abc_list[0][i] != abc_list[2][i]:
        diff += 1

    if diff == 0:
        pass
    elif diff == 1:
        ans += 1
    elif diff == 2 and abc_list[1][i] == abc_list[2][i]:
        ans += 1
    else:
        ans += 2
    diff = 0

print(ans)

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


def fix_str(s1, s2, s3):
    if s1 == s2 == s3:
        return 0
    if s1 == s2 or s1 == s3 or s2 == s3:
        return 1
    else:
        return 2

res = 0
for i in range(n):
    res += fix_str(a[i], b[i], c[i])

print(res)

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] == c[i]:
        ans += 0
    elif a[i] != b[i] != c[i] != a[i]:
        ans += 2
    else:
        ans += 1
print(ans)

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

base = []
for i in range(N):
    if (A[i] == B[i]):
        base.append(A[i])
    elif A[i] == C[i]:
        base.append(A[i])
    elif B[i] == C[i]:
        base.append(B[i])
    else:
        base.append(A[i])

def count(X):
    counter = 0
    for i in range(N):
        if X[i] != base[i]:
            counter += 1
    return counter

print(count(A)+count(B)+count(C))

Solution (Python):
N = input()
A = list(input())
B = list(input())
C = list(input())
count = 0
for i in range(int(N)):

  a = A[i]
  b = B[i]
  c  =C[i]
  if a != b and a != c and c != b:
    a = b = c = "a"
    count += 2
  elif a == b and a != c:
    count += 1
  elif a != b and a == c:
    count+=1
  elif c != a and b == c:
    count +=1
print(count)

Solution (Python):
N = int(input())
L = [input() for i in range(3)]
ans = [0] * N
tmp = []
for i in range(N):
  for j in range(3):
      tmp.append(L[j][i])
  ans[i] = len(set(tmp)) - 1
  tmp = []
print(sum(ans))

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
k = 0
for i in range(n):
    p = 0
    if a[i] != b[i]:
        p+=1
    if b[i] != c[i]:
        p+=1
    if c[i] != a[i]: 
        p+=1

    if p == 2:
        k += 1
    elif p == 3:
        k+=2
print(k)

Solution (Python):
n=int(input())
s=[list(input()) for i in range(3)]
p=list(s[0])
for j in range(n):
  if s[1][j]==s[2][j]:
    p[j]=s[1][j]
c=0
for k in range(n):
  if p[k]!=s[0][k]:
    c+=1
  if p[k]!=s[1][k]:
    c+=1
  if p[k]!=s[2][k]:
    c+=1
print(c)

Solution (Python):
n = int(input())
a = []
for i in range(3):
    a.append(list(input()))
c = 0
for i in range(n):
    d,e = [],[]
    for j in range(3):
        d.append(a[j][i])
    e = [d.count(i) for i in d]
    c += 3 - max(e)
print(c)

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

x = 0

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

print(x)

Solution (Python):
n=int(input())
string_list=[input() for i in range(3)]

result = 0

for i in range(n):
  temp = set([string_list[0][i], string_list[1][i], string_list[2][i]])
  result += len(temp) - 1

print(result)

Solution (Python):
import collections

N = int(raw_input())
moji = []
moji.append(raw_input())
moji.append(raw_input())
moji.append(raw_input())

count = 0


for i in range(N):
	row = [moji[0][i],moji[1][i],moji[2][i]]
	count += 3 - collections.Counter(row).most_common()[0][1]

print count

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

Solution (Python):
def dist(A, B, C):
    res = 0
    for a, b, c in zip(A, B, C):
        res += len(set([a, b, c])) - 1
    return res

N = input()
A, B, C = [raw_input() for _ in range(3)]
print dist(A, B, C)

Solution (Python):

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

S = [0 for _ in range(n)]

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

ans = sum(S)

print(ans)

Solution (Python):




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


for idx in range(n):
    
    if a[idx] == b[idx]:
        if a[idx] == c[idx]:
            
            sum += 0
        else:
            
            sum += 1
    else:
        if a[idx] == c[idx]:
            
            sum += 1
        else:
            if b[idx] == c[idx]:
                
                sum += 1
            else:
                
                sum += 2

print(sum)

Solution (Python):

import sys

def io_generator():
	while True:
		yield raw_input()



def cc(a,b,c):
	if a==b and a==c:
		return 0
	elif a==b or b == c or c == a:
		return 1
	return 2

def main(io):
	n = int(io.next())
	sa=io.next()
	sb=io.next()
	sc=io.next()
	ret=0
	for i in range(n):
		ret += cc(sa[i], sb[i],sc[i])
	return ret



if __name__ == "__main__":
	io=io_generator()
	print main(io)

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

print(ans)

Solution (Python):


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

min = 0

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

print("{}".format(min))

Solution (Python):
data = input().split()

n = int(data[0])
word1 = input()
word2 = input()
word3 = input()

mod = 0

for i in range(n):
    if(word1[i] == word2[i] and word2[i] == word3[i]):
        continue
    elif(word1[i] == word2[i] or word2[i] == word3[i] or word1[i] == word3[i]):
        mod+=1
    else:
        mod+=2


print(mod)

Solution (Python):
def run(N, A, B, C):
    ret = 0
    for i in range(N):
        if A[i] == B[i] and B[i] != C[i]:
            ret += 1
        elif A[i] != B[i] and B[i] == C[i]:
            ret += 1
        elif A[i] == C[i] and A[i] != B[i]:
            ret += 1
        elif A[i] == B[i] and B[i] == C[i]:
            pass
        else:
            ret += 2
    return ret


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


if __name__ == '__main__':
    main()

Solution (Python):
import collections

n=int(input())
string_list=[input() for i in range(3)]

a = string_list[0]
b = string_list[1]
c = string_list[2]

ans = 0
for ac, bc, cc in zip(a, b, c):
    tmp = ac+bc+cc
    c = collections.Counter(tmp)
    ans += 3 - c.most_common()[0][1]

print(ans)

Solution (Python):
num1 = int(input())
num2 = input()
num3 = input()
num4 = input()

num2 = list(num2)
num3 = list(num3)
num4 = list(num4)

_num = 0
for num in range(num1):
    if(num2[num] == num3[num]):
        if(num2[num] == num4[num]):
            _num += 0
        else:
            _num += 1
    else:
        if(num2[num] == num4[num]):
            _num += 1
        else:
            if(num3[num] == num4[num]):
                _num += 1
            else:
                _num += 2

print(_num)

Solution (Python):
import sys
file= lambda location: {True:sys.stdin, False:open(location,"r")}[location==""]

location=""

raw_input=sys.stdin.readline

N=int(raw_input())
A=raw_input().strip()
B=raw_input().strip()
C=raw_input().strip()
ans=0
for i in xrange(N):
	m=len(set(A[i]+B[i]+C[i]))
	ans=ans+(m-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]:
		if a[i] != c[i]:
			ans += 1
		
	else:
		if a[i] == c[i]:
			ans += 1
		else:
			if b[i] == c[i]:
				ans += 1
			else :
			 	ans += 2

print(ans)

Solution (Python):

def diff(a,b,c):
	string = [a,b,c]
	num = len(list(set(string)))
	if num == 3:
		return 2
	elif num == 2:
		return 1
	elif num == 1:
		return 0

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

count=0
for i in range(N):
	count += diff(A[i],B[i],C[i])

print(count)
exit()

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

Solution (Python):
N=int(input())
A=input()
B=input()
C=input()
retval=0
for a,b,c in zip(A,B,C):
    if a==b and b==c:
        continue
    elif a==b or b==c or c==a:
        retval+=1
    else:
        retval+=2

print(retval)

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

import collections
answer=0
N=int(N)
for i in range(N):
    if len(set([A[i],B[i],C[i]]))==1:
        continue
    if len(set([A[i],B[i],C[i]]))==3:
        answer+=2
        continue
    i2=0
    
    for k,v in collections.Counter([A[i],B[i],C[i]]).items():
        if v!=max(collections.Counter([A[i],B[i],C[i]]).values()):
            
            
            answer+=v
    
print(answer)

Solution (Python):
def data_input():
    a = input()
    b = input()
    c = input()
    d = input()
    return (int(a),b,c,d)
def answer():
    n,a,b,c = data_input()
    counta = 0
    for i in range(n):
        count = 0
        if a[i] != b[i]:
            count += 1
        if a[i] != c[i]:
            count += 1
        if b[i] != c[i]:
            count += 1
        if count != 0:
            count -= 1
        counta += count

    return counta

def output():
    res = answer()
    print(res)
output()

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
res = 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]:
        res += 2
    else:
        res += 1
else:
    print(res)

Solution (Python):

import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())

d = defaultdict(lambda : defaultdict(int))

for i in range(3):
    s = list(input())
    for j in range(n):
        d[j][s[j]] += 1
ans = 0
for i in range(n):
    mx = max(d[i], key=d[i].get)
    for j in d[i]:
        if mx != j:
            ans += d[i][j]
print(ans)

Solution (Python):
n = int(input())
a = []
a.append(input())
a.append(input())
a.append(input())

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

print(cnt)

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

for i in range(N):
    cash = 0
    if A[i] == B[i] and B[i] == C[i]:
        cash += 1
    if A[i] != B[i]:
        cash += 1
    if B[i] != C[i]:
        cash += 1
    if C[i] != A[i]:
        cash += 1
    count += cash - 1
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]) & (A[i] != C[i]) & (B[i] != C[i])):
    count+=2
  else:
    if ( (A[i] != B[i]) & (A[i] == C[i]) & (B[i] != C[i]) ):
      count+=1
    if ( (A[i] != B[i]) & (A[i] != C[i]) & (B[i] == C[i]) ):
      count+=1
    if ( (A[i] == B[i]) & (A[i] != C[i]) & (B[i] != C[i]) ):
      count+=1

print(count)

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

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

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

print(count)

Solution (Python):

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

result = 0

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

print(result)

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

cnt = 0

for n in range(N):
    if A[n] == B[n] and A[n] == C[n]:
        pass
    elif A[n] == B[n] or A[n] == C[n] or B[n] == C[n]:
        cnt += 1
    else:
        cnt += 2

print(cnt)

Solution (Python):
import string
n = int(input())
a = input()
b = input()
c = input()
cnt = 0
for x, y, z in zip(a, b, c):
    wl = [0]*26
    wl[string.ascii_lowercase.index(x)] += 1
    wl[string.ascii_lowercase.index(y)] += 1
    wl[string.ascii_lowercase.index(z)] += 1
    cnt += 3 - max(wl)
print(cnt)