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

from collections import Counter
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
    c = Counter([A[i], B[i], C[i]])
    ans += 3 - max(x for x in c.values())
print(ans)

Solution (Python):


l = int(input())
s = [input() for _ in range(3)]

ans = 0
for a, b, c in zip(*s):
    if a == b == c:
        pass
    elif a == b or b == c or c == a:
        ans += 1
    else:
        ans += 2

print(ans)

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]:
        if B[i] != C[i]:
            count += 1
    else:
        if 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()
res = 0
for i in range(n):
  if a[i] == b[i]:
    if c[i] == b[i]:
      res += 0
    else:
      res += 1
  else:
    if c[i] == b[i]:
  	  res += 1
    else:
      if a[i] == c[i]:
        res += 1
      else:
        res += 2
print(res)

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]:
    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 = list(input())
b = list(input())
c = list(input())

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

print(res)

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

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

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

        s = {a, b, c}
        if len(s) == 3:
            ans += 2
        elif len(s) == 2:
            ans += 1

    return ans


def main():
    ans = solve()
    print(ans)


if __name__ == '__main__':
    main()

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

ans = 0

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

    s = set()
    s.add(a)
    s.add(b)
    s.add(c)

    ans += (len(s) - 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]:
    continue
  elif A[i] != B[i] and A[i] != C[i] and B[i] != C[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):
    s = len(set((a[i], b[i], c[i])))
    if s == 1:
        pass
    if s == 2:
        ans += 1
    if s == 3:
        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]:
        if B[i] == C[i]:
            pass
        else:
            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()

res = 0
for a, b, c in zip(A, B, C):
    S = {a, b, c}
    res += len(S) - 1
print(res)

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

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

print(ans)

Solution (Python):
from collections import Counter

N=int(input())
ABC=[input() for i in range(3)]

ANS=0
for i in range(N):
    counter=Counter([ABC[j][i] for j in range(3)])

    ANS+=3-max(counter.values())

print(ANS)

Solution (Python):
def main():
  n = int(raw_input().strip())
  a = [raw_input().strip() for i in xrange(3)]
  foo = 0
  for i in xrange(n):
    bucket = { }
    for s in a:
      bucket[s[i]] = True
    foo += len(bucket) - 1
  print(foo)

if __name__ == '__main__':
  main()

Solution (Python):
n=int(input())
a=list(input())
b=list(input())
c=list(input())
s=0
for i,j,k in zip(a,b,c):
  s += len(set([i,j,k]))-1
print(s)

Solution (Python):
N = int(input())
A = list(str(input()))
B = list(str(input()))
C = list(str(input()))
count = 0
for i in range(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):
n = int(input())

a = list(input())

b = list(input())

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

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):
    d = dict()
    d[a[i]] = d.get(a[i], 0) + 1
    d[b[i]] = d.get(b[i], 0) + 1
    d[c[i]] = d.get(c[i], 0) + 1
    t = max(d[a[i]], d[b[i]], d[c[i]])
    ans += (3 - t)
print(ans)

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:
        continue
    if a == b or b == c or a == c:
        ans += 1
        continue
    ans += 2

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

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

Solution (Python):
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
n=I()
a=S()
b=S()
c=S()
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 a[i]==c[i]:
        ans+=1
    else:
        ans+=2
print(ans)

Solution (Python):


def main():
    """Function."""
    n = int(input())
    a = str(input())
    b = str(input())
    c = str(input())

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

        if temp == 1:
            pass
        elif temp == 2:
            counter += 1
        elif temp == 3:
            counter += 2

    print(counter)


if __name__ == "__main__":
    main()

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

ans = 0
for i in range(N):
    c = set([A[i], B[i], C[i]])
    if len(c) == 3:
        ans += 2
    elif len(c) == 2:
        ans += 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] and b[i] == c[i]:
    count += 0
  elif a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
    count += 1
  else:
    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] and b[i] == c[i]:
        continue
    if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        ans += 1
        continue
    ans += 2

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

print(count)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i,j,k in zip(a,b,c):
  if i == j and j == k:
    continue
  elif i == j or j == k or k == i:
    ans += 1
  else:
    ans += 2
print(ans)

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

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

Solution (Python):
def solve(N, A, B, C):
    ans = 0
    for a, b, c in zip(A, B, C):
        if a == b and b == c and a == c:
            pass
        elif a == b or b == c or a == c:
            ans += 1
        else:
            ans += 2
    return ans


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

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

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

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] 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):
    s = set()
    s.add(A[i])
    s.add(B[i])
    s.add(C[i])
    if len(s)==1:
        pass
    elif len(s)==2:
        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]:
        if B[i] != C[i]:
            ans += 1
    else:
        if B[i] == C[i]:
            ans += 1
        else:
            if C[i] == A[i]:
                ans += 1
            else:
                ans += 2
print(str(ans))

Solution (Python):
N = int(input())
A, B, C = [input() for _ in range(3)]
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):
    a = A[i]
    b = B[i]
    c = C[i]

    if a == b == c:
        continue
    elif a == b:
        ans += 1

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

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

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

print(co)

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

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a = ns()
b = ns()
c = ns()

ans = 0
for ai, bi, ci in zip(a,b,c):
    if ai == bi == ci:
        continue
    
    elif ai == bi or bi == ci or ci == ai:
        ans += 1
    
    else:
        ans += 2
        
print(ans)

Solution (Python):
def num_min_ops(a, b, c):
    res = 0
    for triple in zip(a, b, c):
        m = len(set(triple))
        res += m - 1
    return res


def main():
    _ = int(input())
    a = input()
    b = input()
    c = input()
    r = num_min_ops(a, b, c)
    print(r)


if __name__ == "__main__":
    main()

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

ret=0

for i in range(N):
  a=A[i]
  b=B[i]
  c=C[i]
  
  if a==b==c:
    continue
  elif a!=b and a!=c and b!=c:
    ret+=2
  else:
    ret+=1
print(ret)

Solution (Python):
N = int(input())
A,B,C = input(),input(),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)

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

Solution (Python):
n = int(input())
a=list(input())
b=list(input())
c=list(input())
res = 0
for i in range(n):
    d = len(list(set([a[i],b[i],c[i]])))
    if d == 3:
        res += 2
    elif d == 2:
        res += 1
print(res)

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

Solution (Python):
from sys import stderr, setrecursionlimit
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

n = getInt()
ast = input()
bst = input()
cst = input()

ans = 0

for a, b, c in zip(ast,bst,cst):
    if a == b == c:
        continue
    elif a == b or b == c or c == a:
        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 b[i]!=c[i] and c[i]!=a[i]:
        count+=2
    elif a[i]==b[i] and b[i]==c[i]:
        count+=0
    else:
        count+=1
print(count)

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

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

Solution (Python):
n = int(input())
s = [input() for i in range(3)]
cnt = 0
for i in range(n):
    if s[0][i] != s[1][i]:
        cnt += 1
    if s[2][i] != s[0][i] and s[2][i] != s[1][i]:
        cnt += 1
print(cnt)

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

result = 0

for a, b, c in zip(A, B, C):
    if a == b == c:
        pass
    elif a == b or b == c or a == c:
        result += 1
    else:
        result += 2

print(result)

Solution (Python):

def main():
    buf = input()
    N = int(buf)
    buf = input()
    A = buf
    buf = input()
    B = buf
    buf = input()
    C = buf
    sub_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] or B[i] == C[i] or C[i] == A[i]:
            sub_count += 1
        else:
            sub_count += 2
    print(sub_count)

if __name__ == '__main__':
    main()

Solution (Python):



 
import sys
import math



 

fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile


mod=1000000007
 

def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 

t=1
for tt in range(t):
    n=int(input())
    a=[]
    for i in range(3):
        a.append(str(input()))

    ans=0

    for i in range(n):
        l=set()
        l.add(a[0][i])
        l.add(a[1][i])
        l.add(a[2][i])

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

if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

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

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

print(ans)

Solution (Python):

import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    
    import numpy
    def dprint(*args, **kwargs):
        
        
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    try:
        f = open('input'+ str(inId) + '.txt', 'r')
        sys.stdin = f 
    except Exception:
        dprint('invalid input file')
if outId>0:
    dprint('use output', outId)
    try:
        f = open('stdout'+ str(outId) + '.txt', 'w')
        sys.stdout = f 
    except Exception:
        dprint('invalid output file')
        
    atexit.register(lambda :sys.stdout.close())     
    
N, = getIntList()

s0 = input()
s1 = input()
s2 = input()
r = 0
for i in range(N):
    if s0[i] == s1[i] == s2[i]:
        continue
    if s0[i] == s1[i] or s1[i] == s2[i] or s2[i] == s0[i]:
        r+=1
        continue
    r+=2
print(r)

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

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

Solution (Python):
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

n = getN()
a = input()
b = input()
c = input()
ans = 0
for s,t,r in zip(a,b,c):
    ans += len(list(set([s,t,r]))) - 1

print(ans)

Solution (Python):
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i, j, k in zip(a,b,c):
    if i == j == k:
        pass
    elif i == j or j == k or k == 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):
    S = len(set([a,b,c]))
    if S==3: ans += 2
    elif S==2: 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]:
        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 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()
cnt = [0 for i in range(len(A))]
for i in range(len(A)):
    if A[i] == B[i] == C[i]:
        cnt[i] = 0
    elif A[i] == B[i]:
        cnt[i] = 1
    elif B[i] == C[i]:
        cnt[i] = 1
    elif C[i] == A[i]:
        cnt[i] = 1
    else:
        cnt[i] = 2

print(sum(cnt))

Solution (Python):
def inpl(): return list(map(int, input().split()))


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

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

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

Solution (Python):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  s=set()
  s.add(a[i])
  s.add(b[i])
  s.add(c[i])
  ans+=len(s)-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):
def main():
    n = input()
    aa = raw_input().strip()
    bb = raw_input().strip()
    cc = raw_input().strip()
    count = 0
    for a, b, c in zip(aa, bb, cc):
        s = {a, b, c}
        if len(s) == 3:
            count += 2
        elif len(s) == 2:
            count += 1
    print count


if __name__ == '__main__':
    main()

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 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 i in range(n):
    if (a[i] == b[i]) and (b[i] == c[i]):
        continue
    if (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 not (a[i] == b[i] and b[i] == c[i] and c[i] == a[i]):
		ans += 2
		if a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
			ans -= 1
print(ans)

Solution (Python):
import collections

N=int(raw_input())
A=[[],[],[]]
for i in range(3):
    A[i]=raw_input()
ans=0
for j in range(N):
    s=[A[x][j] for x in range(3)]
    c = collections.Counter(s)
    ans += (len(c) -1)
print ans

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

num_changes = 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:
        num_changes += 1
    else:
        num_changes += 2

print(num_changes)

Solution (Python):
N = int(input())
A, B, C = [input() for _ in range(3)]
ans = 0
for i in range(N):
    if A[i] == B[i] != C[i] or B[i] == C[i] != A[i] or C[i] == A[i] != B[i]:
        ans += 1
    elif not A[i] == B[i] == C[i]:
        ans += 2
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]:
        pass
    elif A[i] == B[i]:
        cnt += 1
    elif B[i] ==  C[i]:
        cnt += 1
    elif C[i] == A[i]:
        cnt += 1
    
    else:
        cnt += 2
    

print(cnt)

Solution (Python):
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]
  if a == b == c:
    continue
  if a == b or b == c or c == a:
    ans += 1
  else:
    ans += 2
print(ans)

Solution (Python):


n = int(input())
A, B, C = input(), input(), input()

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

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

print(num)

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

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]:
    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(), input(), input()
ans = 0
for a, b, c in zip(A, B, C):
    L = len(set([a, b, c]))
    if L == 3:
        ans += 2
    elif L == 2:
        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]:
        continue
    if A[i] == B[i] or B[i] == C[i] or C[i] == A[i]:
        ans += 1
    else:
        ans += 2
print( ans)

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


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

    ans = 0

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

    print(ans)
        


main()

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
	s = set([A[i], B[i], C[i]])
	ans += len(s) - 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 += 0
  elif A[i] == B[i] or B[i] == C[i] or A[i] == C[i]:
    ans += 1
  else:
    ans += 2
print(ans)

Solution (Python):

from sys import stdin


s_in = lambda: stdin.readline()[:-1]  
d_in = lambda: int(stdin.readline())  
ds_in = lambda: list(map(int, stdin.readline().split()))  


N = d_in()
A = s_in()
B = s_in()
C = s_in()

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

Solution (Python):
N = int(input())
A = input()
B = input()
C = input()
Change = 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]:
        Change += 1
    else:
        Change += 2
print(Change)

Solution (Python):

from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007


"""
n,a,b = LI()
ans = [min(a,b),max(0,a+b-n)]
print(ans[0],ans[1])
"""


n = II()
a = S()
b = S()
c = S()
ans = 0
for i in range(n):
    if a[i] == b[i]:
        if b[i] == c[i]:
            continue
        else:
            ans += 1
    else:
        if b[i] == c[i] or c[i] == a[i]:
            ans += 1
        else:
            ans += 2
print(ans)

Solution (Python):
def ii():
    return int(input())
def mi():
    return map(int, input().split())
def li():
    return list(mi())

n = ii()
a, b, c = input().strip(), input().strip(), input().strip()
ans = 0
for i in range(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]:
        ans += 1
    else:
        ans += 2
print(ans)

Solution (Python):

n=int(input())
a,b,c=input(),input(),input()
count=0
for i in range(n):
    s=set([a[i],b[i],c[i]])
    if len(s)==3:
        count+=2
    elif len(s)==2:
        count+=1
print(count)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = [S() for _ in range(3)]
    r = n * 3
    for i in range(n):
        t = collections.defaultdict(int)
        for j in range(3):
            t[a[j][i]] += 1
        r -= max(t.values())

    return r



print(main())